Solved

Database ID in pipe query

  • 30 December 2021
  • 2 replies
  • 253 views

Userlevel 1

I have a situation and I can't find a solution.

I need to make a query to filter a pipe, but in it, I need my client's ID that is filled in it in the databases.

That is, I need the pipe query to bring the ID filled in it in the databases.

Has anyone been through something like that?

icon

Best answer by genietim 30 December 2021, 11:05

View original

2 replies

Userlevel 7
Badge +12

I am quite unsure if I correctly understood your situation.

Let me try to phrase what I understood: you have a pipe and a connected database, “clients”. Now, what you want to do, is to query the cards in the pipe which have a certain connected client.

Is this correct?

Then I would suggest to approach from the other way: you can query the database entry (the client) with all its connected cards (meaning, the cards in the pipe and possibly other pipes and databases the client is connected to), and filter the cards to only use the ones from the pipe you want afterwards.

Example query:

query {
table_record(id: <theTableRecordId>) {
title,
id,
status {
id, name
},
record_fields {
name, value, array_value, field { internal_id id }
},
parent_relations {
id, name, repo_items {
edges {
node {
... on Card { id, title }
... on TableRecord { id, title }
}
}
}
},
status {
id, name
}
}
}

Adjust the inner workings (i.e. on Card … fields) to your likings — that’s where you will find the cards of the pipe(s).

Userlevel 7
Badge +12

You may need to look into pagination if your clients can have more than 50 connected cards.

Reply