I am not sure if retrieving specific column values is possible. What you could do is take all the values and filter out the ones you need . I am using same approach for now. May be someone from Monday could confirm otherwise.
Hey there @Shinny and @vishwajeets
That’s a great question! It is currently not possible to retrieve a specific column by name, or ID, and I would indeed recommend querying all of the board data and then filtering the specific values you need in your application logic instead. I hope that helps. 🙂
EDIT: I stand corrected - please check @mitchell.hudson 's post just below my own that provides a working API query example that can look up column values based on column ID.
-Alex
Hi @Shinny and @vishwajeets
@AlexSavchuk, I might be reading the question wrong, but you can actually query based on the column_id
. I have attached a sample query below.
{
boards(ids: XXX) {
items {
column_values (ids: ["text", "status"]) {
title
text
}
}
}
}
This will return the data for each item in the board, but only the column values that you have requested.
{
"data": {
"boards": [
{
"items": [
{
"column_values": [
{
"title": "Status",
"text": "Done"
},
{
"title": "First Name",
"text": "Test"
}
]
},
{
"column_values": [
{
"title": "Status",
"text": null
},
{
"title": "First Name",
"text": ""
}
]
}
]
}
]
},
}
I only have a few items in this board. You can find the column id’s by using the API, or by enabling the developer tools in monday Labs.
Let me know if I have misunderstood your question.
Indeed, as @mitchell.hudson shows, it is possible to retrieve column data by columnId. This is not possible by column_name. It looks like this is because column names can be changed by the user, where column ids are set by the system and can’t be changed.
@mitchell.hudson oh, that makes perfect sense! I am sorry for the misleading answer previously, and I really appreciate your clarification here, especially with a working code example as well.
@basdebruin thank you for siding with Mitchell here 🙂
-Alex
Thanks all! This absolutely solves the case.