0

I am just doing a simple add_rows request and need to set the overrideValidation to True so that an insert doesn't fail because of a misspelling on a Picklist column.

   row.to_top = True
   row.cells.append({
       #date of service
       "columnId": column_id,
       "displayValue": "not a doc",
       'strict': False
   })
   row.cells.append({
       #Summary Finished
       "columnId": column_id2,
       "value": True
   })
   response = smartsheet_client.Sheets.add_rows(
       sheet_id,       # sheet_id
       [row],
       )

Response: { status: 400 Bad Request content: { { "errorCode": 5536, "message": "The value \"not a doc\" could not be saved in column \"Prescribing MD\". This column is restricted to PICKLIST values only.", "refId": "195gawcb3hbup" } } {"result": {"code": 5536, "errorCode": 5536, "message": "The value \"not a doc\" could not be saved in column \"Prescribing MD\". This column is restricted to PICKLIST values only.", "name": "ApiError", "recommendation": "Do not retry without fixing the problem. ", "refId": "195gawcb3hbup", "shouldRetry": false, "statusCode": 400}}

Brad Cook
  • 3
  • 2

1 Answers1

1

Include the overrideValidation parameter in every cell you want to override.

   row.cells.append({
       #date of service
       "columnId": column_id,
       "displayValue": "not a doc",
       "overrideValidation": True,
       'strict': False
   })

See the API docs for more details on what parameters can be included.

Note that you must be an administrator of the sheet to override validation. Also, consider that data validation is typically enabled specifically to prevent values like typos from entering otherwise clean data. If this is not a priority for your needs, you may want to consider turning off validation, rather than try to bypass it.

Software2
  • 2,358
  • 1
  • 18
  • 28