Is Picklist always Strict through the API?
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
-
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
-
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.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives