How to write to a Smartsheet "Restrict to date only" cell using API?

Devi
Devi ✭✭
edited 10/19/22 in API & Developers
Hello All! Need your help. With Python using Smartsheet API, I am trying to write to a date only column. I am getting the below error.

v1=datetime.datetime.utcnow().date()
new_cell = ss_client.models.Cell({'column_id': 123456789,
                              'object_value': v1,
                              'strict': False})

{"result": {"errorCode": 1012, "message": "Required object attribute(s) are missing from your request: cell.value.", "name": "ApiError", "recommendation": "Do not retry without fixing the problem. ","statusCode": 400}}


new_cell = ss_client.models.Cell({'column_id': 123456789,
                              'object_value': "2019-10-13",
                              'strict': False})

"errorCode": 5536, "message": "The value \"2019-10-13\" could not be saved in column \"col3\". This column is restricted to DATE values only."


Best Answer

Answers