Updating subitem column values with API version 2023-10

Hi,

Is it possible to update the subitem’s column values based on the subitem Id (“id ‘ID!’ The subitem’s unique identifier.”)?

The id of the subitem I want to edit is: 1285809696
The id of the board that contains this subitem is: 1274270217

I’m using the following query in Python:

query3 = """mutation ($columnVals: JSON!) {change_multiple_column_values(item_id: 1285809696, board_id:1274270217, column_values:$columnVals) {id}}"""
vars = {'columnVals': json.dumps(
    {'epic': 'ZK-2222'})}
data = {'query': query3, 'variables': vars}
monday_headers = {"Authorization": *API_KEY*, 'API-Version' : '2023-10'}

r = requests.post(url=monday_apiUrl, json=data, headers=monday_headers)
r = r.json()

And I’m getting this response:
{‘error_code’: ‘InvalidColumnIdException’, ‘status_code’: 200, ‘error_message’: “This column ID doesn’t exist for the board”, ‘error_data’: {‘column_id’: ‘epic’, ‘board_id’: None, ‘error_reason’: ‘store.monday.automation.error.missing_column’}}

I have confirmed that the id of the subitem’s column I want to edit is: ‘epic’

Thanks.

image

The subitems relative_link is: ‘/boards/1277744230/pulses/1285809696’

Hello there @felipeLW and welcome to the community!

I hope you like it here :muscle:

It looks like you might be trying to use the main items’ board instead of the subitems board. When you go into a subitem, the board ID you see in the URL is not the subitems’ board ID, but the main board’s ID.

To find the subitems’ board ID, you can get an item ID of any item that has subitems in it, and use that item’s ID in a query like this one:

{
  items(ids: 1234567890) {
    subitems {
      board {
        id
      }
    }
  }
}

Then you can use the subitems’ board ID in your original query.

I hope that helps!

Cheers,
Matias

1 Like

Hello Matias,

Thanks for your prompt reply!

I have adapted the query and now it works.

Kind regards,

Felipe

1 Like

We are happy to hear that, @felipeLW! Glad the solution from @Matias.Monday worked.

Feel free to reach out with any other questions :smiley:

Best,
Rachel