Skip to main content

I’m trying to run this code to update column values on an existing item by its ID, but I’m getting this error:


List dimension mismatch on variable $id and argument item_id (iID!] / ID)


My ID is an INT so not sure what I’m doing wrong here.


 $id = 5543373657
$new_service_level = "Digital";
$new_monthly_rate = "$250";

$query = 'mutation ($id: (ID!], $columnVals: JSON!) { change_multiple_column_values (board_id:XXXXXXX, item_id:$id, column_values:$columnVals) { id } }';

$vars = a
'id' => $id,
'columnVals' => json_encode(n
'status' => ='label' => $new_service_level], //Service Level
'text17' => $new_monthly_rate //Monthly Bill Rate
])];

$data = @file_get_contents($apiUrl, false, stream_context_create(r
'http' => =
'method' => 'POST',
'header' => $headers,
'content' => json_encode(n'query' => $query, 'variables' => $vars]),
]
]));

$tempContents = json_decode($data, true);

I fixed this by changing my code to:


$query = 'mutation ($id: ID!, $columnVals: JSON!) { change_multiple_column_values (board_id:XXXXXXX, item_id:$id, column_values:$columnVals) { id } }';

Hello there @adouglas_ivet I am glad you found the source of the issue 😁


Reply