Hello,
I’ve been struggling to change the value of some columns of an item.
I am using Python to request the API.
These are the 2 columns I want to change:
{'id': 'status_1', 'title': 'Etape', 'value': '{"index":5,"invalid":false,"changed_at":"2023-06-06T08:07:50.170Z"}'}
{'id': 'multi_select', 'title': 'Types', 'value': '{"ids":[2,1,4],"changed_at":"2023-06-06T07:28:20.062Z"}'}
I couldn’t find in the API documentation the needed format for these types of column. For simple text, it’s pretty easy. For these types of column, I encounter some difficulties.
This is my code:
query = '''
mutation {
change_simple_column_value(
board_id: %s,
item_id: %s,
column_id: "%s",
value: "%s"
) {
id
}
}
''' % (0123456789, 987654321, 'status_1', '{"label": "Some label"}')
response = requests.post(url=MONDAY_URL, json={'query': query}, headers=monday_headers)
Note that I also tried putting {"id": "1"}
into the value to change the status from the id and not from the label.
For the ‘multi_select’ column, I used the same code but with '{"ids":%s}' % json.dumps([1])
for the value.
None of these work. I get the following errors:
- For ‘status_1’ column:
'errors': [{'message': 'Parse error on ": " (STRING) at [7, 28]'
- For ‘multi_select’ column:
'errors': [{'message': 'Parse error on ":[1]}" (STRING) at [7, 26]'
I know the problem is the value, but I couldn’t find what I am doing wrong.
I’d be grateful for your help.
Antoine