In short, I have items with subitems. At the moment subitems have only two fields, the name and a text field called “Description”.
I’m trying to update its values through PHP API with this code:
$query = 'mutation ($boardId: Int!, $itemId: Int!, $columnValues: JSON!) {
change_multiple_column_values (
board_id: $boardId,
item_id: $itemId,
column_values: $columnValues
) {
id
}
}';
$columns = [
"name" => "some text here",
"description" => "some text here"
];
$variables = [
'boardId' => 0123456789, //subitems have their own board Id https://community.monday.com/t/updating-subitems-via-api/16626
'itemId' => (int) 123456,
'columnValues' => json_encode($columns)
];
$data = [
'query' => $query,
'variables' => $variables
];
$client = new Client();
$options = [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => XXXXX
],
'json' => $data
];
And I get this errors:
Array (
[error_code] => InvalidColumnIdException
[status_code] => 200
[error_message] => This column ID doesn't exist for the board
[error_data] => Array (
[column_id] => description
[board_id] =>
[error_reason] => store.monday.automation.error.missing_column
)
)
In a near future, we want to have more custom fields, how can I update name + custom fields via API?