Is Picklist always Strict through the API?

Options
Jose Cardenas
Jose Cardenas ✭✭
edited 12/09/19 in API & Developers

I'm trying to update cells via the API and one the cells is in a Dropdown list column. However, when the API tries to add a value to the cell. 

I'm getting a 1042, "The value for cell in column 7098131356849892, beagle, did not conform to the strict requirements for type PICKLIST."

However, I've checked the sheet, the value does not exist in the Dropdown list but column is not strict, so I thought I'd be able to add the value in. So simple question is the Dropdown list always strict? Before I attempt to update the cell should I update the column?

Comments

  • sean59916
    sean59916 ✭✭✭
    Options

    Hi, 

    I believe you can disable the strict rules that are set...

    "If, however, you want the same flexibility as the Smartsheet Web app, you can disable the strict rules, and we’ll do our best to make sense of it. To enable lenient parsing simply include "strict": false in the Cell object in your request body."

     

    The parsing rules for picklist:

    lenient - All numeric and text values are valid. Formatted numbers are parsed like TEXT_NUMBER formatted numbers.

    strict - The value must be a string and must be one of the options for the picklist.

     

    See https://smartsheet-platform.github.io/api-docs/#cell-reference

    I also find Stack overflow to be a good resource for Smartsheet API related questions.

    I hope this helps?

    Sean

  • dAVE Inden
    dAVE Inden Employee
    Options

    I just wanted to reach out and confirm here that updating a cell in a Dropdown column is strict by default. Without anything specifically set one can only provide values that are currently in the Dropdown column properties as an option. Strict cell value parsing has been around since the creation of the API which pre-dates the ability to make the column strict via the UI with column validation.

    To add a value that isn't an option in the Dropdown one would add "strict": false in the Cell object as Sean notes above. That should make it so the request gets through to add the value without any changes needed for the column properties.