Items_page_by_column_values error

Hi,
Happy to discover Monday’s developpers community.
I faced some issues on my firsts queries and i need your help.
When i launch this query :
“query {
items_by_column_values (board_id: 508611278, column_id: “date”, column_value: “2019-02-06”) {
id
name
}
}”
I received a warning “Replaced by Query.items_page_by_column_values since 2023-10”.
But, when i tried the new one, i also received an error (I just copy an past the documentation sample (?)) :
“query {
items_page_by_column_values (limit: 50, board_id: 508611278, columns: [{column_id: “text”, column_values: [“This is a text column”]}, {column_id: “country”, column_values: [“US”, “IL”]}]) {
cursor
items {
id
name
}
}
}”

Error :
{
“errors”: [
{
“message”: “Field ‘items_page_by_column_values’ doesn’t exist on type ‘Query’”,
“locations”: [
{
“line”: 2,
“column”: 3
}
],
“path”: [
“query”,
“items_page_by_column_values”
],
“extensions”: {
“code”: “undefinedField”,
“typeName”: “Query”,
“fieldName”: “items_page_by_column_values”
}
}
],
}

Does somebody has an idea ?
I’m sorry, i just start to work with Monday’s API…
Thanks
Simon

hi @simonUnista

Welcome to the community! Did you set the API version to 2023-10 when you tried this example? In the API Playground you can select the API version here:

image

1 Like

Hello @simonUnista,

What @basdebruin suggested is my first guess too.

Is that the source of the issue?

(Thank you @basdebruin !!!)

1 Like

The same problem;

in playground all works as expected , but using PostMan “NO”

My Request:

curl --location 'https://api.monday.com/v2/' \
--header 'Authorization: {{Token}}' \
--header 'API-Version: 2023-07' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=Ocyu6TAUf5a1r5OJgaMqnLTKP5LrnhTiTow2q57owbM-1696885820-0-Aeg4UtxPo+PxTpHoOAQ8XUKgeVTQBXBpJqTe84vKbTd3pCYyqXfPr8JU/vFlKrxtYZfaswMv42HRg7qVn9M1JmbQQmbF1uuGu4SOOrHLn4xN' \
--data '{
  "query": "query {items_page_by_column_values (board_id: 1286739187,columns: {column_id: \"project_owner\", column_values: [\"49945459\"]}) { cursor items { id name state } }}"
}'

Response:

Error :
{
“errors”: [
{
“message”: “Field ‘items_page_by_column_values’ doesn’t exist on type ‘Query’”,
“locations”: [
{
“line”: 2,
“column”: 3
}
],
“path”: [
“query”,
“items_page_by_column_values”
],
“extensions”: {
“code”: “undefinedField”,
“typeName”: “Query”,
“fieldName”: “items_page_by_column_values”
}
}
],
}

but when use older approach with items_by_column_values see [“Replaced by Query.items_page_by_column_values since 2023-10”.] warning…

@basdebruin can you please help in this question?

Hello there @Tasha and welcome to the community!

I hope you like it here :muscle:

You need to pass a different version of the API in the headers:

header 'API-Version: 2023-10'

That should do the trick :grin:

Let me know how that goes!

Cheers,
Matias

2 Likes

Thank you! It works as expected :sunny:

1 Like

@Tasha that’s great to hear!

Please reach out to us with any other questions :smiley:

Best,
Rachel

1 Like

Hello- This tread is great and answered my question about the query type error. However, I’m getting a parsing error on this that I just can not seem to figure out. Here is my query:
{
“query”: “query { items_page_by_column_values (board_id: 5524419471, columns: {column_id: "opportunity_number8"}), column_values: ["0065a00001Ck712AAB"]}}) { cursor items { id name}}}”
}

And the error is
“Parse error on "[" (LBRACKET) at [1, 121]”,

Any help would be GREATLY appreciated!

Thanks!

And as these things usually go, as soon as I post I find my error. Corrected:
{
“query”: “query { items_page_by_column_values (board_id: 5524419471, columns: {column_id: "opportunity_number8", column_values: "0065a00001Ck712AAB"}) { cursor items { id name}}}”
}

2 Likes

I do strongly recommend writing your queries in the API Playground, since it can do a good job at highlighting incorrect structures on a number of things around the items_page.

2 Likes

hey!!! according to the latest version of the API, how should I rewrite this query?

var query3 = query { items (ids: [${idValue99}]) { column_values { text } }};

let query = query3;

fetch (“https://api.monday.com/v2”, {
method: ‘post’,
headers: {
‘Content-Type’: ‘application/json’,
‘Authorization’ : ‘vvvvv’
},
body: JSON.stringify({
query : query
})
})

.then(res => res.json())
//.then(res => console.log(JSON.stringify(res, null, 2)));

.then(res => {
const responseText = JSON.stringify(res, null, 2);
console.log(responseText);

Hello there @Daniel2,

This query is OK for version 2023-10 :grin:

You might also want to check this in case you want to get more data from specific column types.

Cheers,
Matias

2 Likes