You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use smartsheet.Sheets.get_column() to retrieve a column whose type is CONTACT_LIST, the returned JSON payload improperly reflects a column type TEXT_NUMBER. If I then call update_column() to update the contact list, the API returns an error:
"errorCode": 1090, "message": "Column.type is required when changing symbol, systemColumnType, options, contactOptions, or autoNumberFormat.", "refId": "h3w1i3"
All well and good, but if I then call update_column() with type set to CONTACT_LIST, I get a different error:
{"result": {"code": 1087, "errorCode": 1087, "message": "The column specified is used in a conditional formatting rule, so the column cannot be deleted and its type cannot be changed.", "name": "ApiError", "recommendation": "Do not retry without fixing the problem. ", "refId": "vuhctf", "shouldRetry": false, "statusCode": 400}}
Of course, I don't WANT to delete the column or change its type -- the type should already be CONTACT_LIST. When looking at the column properties in the web app, the type is correct: CONTACT_LIST. But for some reason the API thinks it is a TEXT_NUMBER and thus makes it impossible to update the contact list options!
The text was updated successfully, but these errors were encountered:
I got into the very same problem as you did. Although, the issue is quite old, I want to post the solution to the problem:
the types CONTACT_LIST and MULTI_CONTACT_LIST are not retrieved due to the api being backwards compatible (see here).
you can change the compatibility level via retrieving the object_level field as well as setting the api level to 2
be careful, the structure of the column will vary depending on the column types of your sheet. For writing back the value, you could do the following:
new_cell=smartsheet.models.Cell()
new_cell.column_id=column_mapper[update.column_name]
ifupdate.column_type=="MULTI_CONTACT_LIST":
ifupdate.value:
new_cell.object_value=smartsheet.models.MultiContactObjectValue()
new_cell.object_value.values= [smartsheet.models.ContactObjectValue(props={"email": mail.strip()}) formailinupdate.value.split(",")] # assuming update.value to be of form "chuck@norris.com, someUser@test.com,..."else:
new_cell.value=smartsheet.models.ExplicitNull()
hope this helps everyone stepping into the same problem :-)
When I use
smartsheet.Sheets.get_column()
to retrieve a column whose type is CONTACT_LIST, the returned JSON payload improperly reflects a column type TEXT_NUMBER. If I then callupdate_column()
to update the contact list, the API returns an error:"errorCode": 1090, "message": "Column.type is required when changing symbol, systemColumnType, options, contactOptions, or autoNumberFormat.", "refId": "h3w1i3"
All well and good, but if I then call
update_column()
with type set to CONTACT_LIST, I get a different error:{"result": {"code": 1087, "errorCode": 1087, "message": "The column specified is used in a conditional formatting rule, so the column cannot be deleted and its type cannot be changed.", "name": "ApiError", "recommendation": "Do not retry without fixing the problem. ", "refId": "vuhctf", "shouldRetry": false, "statusCode": 400}}
Of course, I don't WANT to delete the column or change its type -- the type should already be CONTACT_LIST. When looking at the column properties in the web app, the type is correct: CONTACT_LIST. But for some reason the API thinks it is a TEXT_NUMBER and thus makes it impossible to update the contact list options!
The text was updated successfully, but these errors were encountered: