Thanks!
So, what you are currently querying is this: https://api-docs.pipefy.com/reference/objects/Card/
And when you look there, you can find the attribute `fields`, that you want to query.
That makes your query look like this:
query {
card(id: 638121829) {
title done id updated_at
fields { name array_value value field { id internal_id type } }
}
}
Note that instead of only “fields”, I also added what values you might want to have of the field: the name of the field, its value, and also the id and its type.
You find out how these parts of the query are called when you click on the “CardField” link in the documentation listed above right next to the attribute “fields” that I hinted at above.
If you now also need to know for each field, what phase it comes from, you have to go even a level deeper: notice the “phase_field” attribute, and therein the attribute “phase”, which will help you separte the fields from the start form from the fields in the other phases in your code.
Therefore, a final query could look like this:
query {
card(id: 638121829) {
title done id updated_at
fields { name array_value value field { id internal_id type }
phase_field { id index_name label phase { id index name } }
}
}
}
(where, again, I made some selection of other attributes you could be interested in. You might find others in the documentation)
In your code, you would then have to filter the card’s fields based on the phase_field → phase → name property to be == “Start form”. Or, if you have another phase you also named “Start form”, you can use the phase_field → phase → index property to be == 0.0.
With your answer, @Lais Laudari , how would you suggest they could distinguish between fields on the start form and fields elsewhere (except for manually filtering them, knowing which name the fields on the start form have)?
You are right @genietim!
Your proposal are the best way, I was justing lookinkg for the query ready to use.
@wf-suchit-gupta do you get what you need?
@genietim Im checking a way to do that and I will be back to you soon!
I mean, if you are ok with the “filtering in your code” I proposed in my answer, you can simply adjust your query to either include the fields → phase_field → phase → index fields, e.g., or add on your phase_history the phase → fields → index & name fields.
Hi @wf-suchit-gupta, hope you are fine!
You can use this query to get value from a specific card:
{
card(id: 2712489) {
title
assignees {
id
}
comments {
text
}
comments_count
current_phase {
name
}
done
due_date
fields {
name
value
}
labels {
name
}
phases_history {
phase {
name
}
firstTimeIn
lastTimeOut
}
url
}
}