Hey there, I’m having some trouble creating an item with a numeric column value. No matter what formatting I try, I get an error that says I am using an incorrect data structure for that column. Code and error response is below. Any tips appreciated!
query6 = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:BOARD_ID_HERE, item_name:$myItemName, column_values:$columnVals) { id } }'
vars = {
'myItemName' : 'Hello everyone!',
'columnVals' : json.dumps({
'numbers1' : {'value' : '25'}
})
}
data = {'query' : query6, 'variables' : vars}
r = requests.post(url=apiUrl, json=data, headers=headers)
numbers1 is the ID of the column in question. I’ve also tried the following formats in place of that line:
'numbers1' : {'value' : "25"}
'numbers1' : {'value' : 25}
'numbers1' : {'value' : "\\"25\\""}
Every time I get the same error:
{'error_code': 'ColumnValueException', 'status_code': 200, 'error_message': 'invalid value, please check our API documentation for the correct data structure for this column. https://monday.com/developers/v2#column-values-section', 'error_data': {'column_value': '{"value"=>"25"}', 'column_type': 'NumericColumn'}}
I’ve checked the documentation and can’t find any examples in Python of a numeric value being supplied for the create_item action. Any help appreciated on how to format numeric values in the request variables!