rohan
(rohan)
July 31, 2020, 11:32am
1
Hello, monday.com community. I am trying to get the name of a column given its id and board id. My code is
query($boardId: [Int], $columnId: [String]) {
boards(ids:$boardId){
columns(ids:[$columnId]){
title
}
}
}
const variables = { boardId, columnId };
const response = await mondayClient.api(query, { variables });
I am facing the following error
{
[0] errors: [
[0] {
[0] message: 'List dimension mismatch on variable $columnId and argument ids ([[String]]! / [String])',
[0] locations: [Array],
[0] fields: [Array]
[0] }
[0] ],
[0] }
Would appreciate any help. Thank You!!.
Did you try ```
columns(ids:$columnId){
if $columnId is already an array.
1 Like
TMNXT-Dev
(Ilja Zweigert)
July 31, 2020, 11:56am
3
Hey @rohan ,
try it like that:
const variables = variables: { boardId: [boardId], columnId: [columnId] }
Greetings
1 Like
rohan
(rohan)
July 31, 2020, 12:02pm
4
1 Like
@TMNXT-Dev and @LaurentConroux - thanks for being on top of this! You guys rock.
@rohan I’m glad the community was helpful Sorry we weren’t the first to resolve this!
-Alex
aquibk
(Aquib Zafar)
February 10, 2021, 2:24pm
6
@TMNXT-Dev and @LaurentConroux I am also getting the same error when I am trying to fetch by column values.
I have tried the above mentioned solution as well but still getting the same error.
.
Any suggestion would be appreciated…!
TMNXT-Dev
(Ilja Zweigert)
February 10, 2021, 2:59pm
7
Hey @aquibk ,
the items_by_column_values doesn’t accept Arrays.
This is why you get the “dimension mismatch”.
What I do in situations like this, I go to the API playground and look for the query/mutation I want to use.
And look for the definition in there:
Simply change:
$boardId: Int!
const vara = { boardId: boardId }
And make sure you pass an Integer and not an Array.
Adjust the other two parameters as well and it should work.
Greetings
1 Like
system
(system)
Closed
February 19, 2021, 3:59pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.