Create_item function with column_values not working

Hi,

I want to create a new item with column values already applied to it, but there is no proper example all around the internet to get information from.
I have this code:

query3 = 'mutation { create_item (board_id:1917614834, group_id: topics, item_name: Teszt2, column_values: "{\"status\":{\"label\":\"Medium\"}}}' data = {'query': query3} r = requests.post(url=apiUrl, json=data, headers=headers) # make request print(r.json())

But it says:
{'errors': [{'message': 'Parse error on ":{" (STRING) at [1, 111]', 'locations': [{'line': 1, 'column': 111}]}], 'account_id': 10454884}

I don’t know how to write the query line after column_values.
Can you please help me with the correct code line for the query?
I always get a Parse error, no matter what type of column I want to update.

Hello @ChrisNemes,

group_id and item_name are supposed to be a strings
Try this:

mutation { create_item (board_id:1913125449, item_name: "Teszt2", group_id: "topics",create_labels_if_missing: true, column_values:"{\"status\":{\"label\":\"Medium\"}}") {
  id
}}

Tried your solution, and I got the same error:
query3 = 'mutation { create_item (board_id:1913125449, item_name: "Teszt2", group_id: "topics",create_labels_if_missing: true, column_values:"{\"status\":{\"label\":\"Medium\"}}") { id}}'

Result:
{'errors': [{'message': 'Parse error on ":{" (STRING) at [1, 138]', 'locations': [{'line': 1, 'column': 138}]}], 'account_id': 10454884}

I’m using the API in python, if it counts.

Sorry, I’m not conversant in Python but the solution I provided works. I’ve tested it in the playground.

1 Like

Thank you for your efforts! :slight_smile:

1 Like