Update a column's text value

let’s say I have a board like below, I want to update the Status column based on the item id. I want to update the text of Customer Status column if a matched item id was found. In this case, the text ‘Active’ will be change to ‘Inactive’. How to do it python?

I tried:

query = ‘mutation ($columnVals: JSON!) { create_item (board_id:1234, item_name:12345, column_values:$columnVals) { id } }’
vars = {
‘columnVals’ : json.dumps({
‘status3’ : {‘text’ : ‘Inactive’}
})
}

data = {‘query’ : query, ‘variables’ : vars}
r = requests.post(url=apiUrl, json=data, headers=headers)
jsondata = r.json()
print(jsondata)

board item info:

“boards”: [
{
“name”: “myboard”,
“id”: “1234”,
“description”: “”,
“items”: [
{
“name”: “12345”,
“id”: “1234567”,
“column_values”: [
{
“title”: “Subitems”,
“id”: “subitems”,
“type”: “subtasks”,
“text”: “02342”
},
{
“title”: “Customer Status”,
“id”: “status3”,
“type”: “color”,
“text”: “Active Customer”
}]
}
]
}
]

Do you have a list of item IDs which you are cross referencing? Also could you post whatever code you have already?

Hello @jason_moday,

What your query is doing is creating an item. To update one you’d use the change_column_value mutation. See below. Perhaps what you are wanting is to first query the board based on some criteria then create it if it doesn’t exist or update it?