How to write to a Smartsheet column with dropdown list column type and with restricted selection.

I am encountering an error while attempting to input data into a Smartsheet column characterized by a dropdown list column type that enforces restricted selection from a predefined list. The error message is as follows: {"response": {"statusCode": 400, "reason": "Bad Request", "content": {"detail": {"index": 0, "rowId": 3268859086792580}, "errorCode": 1235, "message": "Value is not supported for this column type. Use objectValue instead.", "refId": "cj7h6"}}}

I tried the below function to write to that column:

def add_value_to_cell(column_map, value, column_name, ss_client):

new_cell = ss_client.models.Cell()

new_cell.column_id = column_map[column_name]

new_cell.object_value = value # Use object_value instead of value

new_cell.strict = True # Set strict to True for dropdown list columns

return new_cell

Answers