Search code examples
javascriptjsonsmartsheet-apismartsheet-api-2.0

Populating/Amending the Options of a "PICK LIST" column type in Smartsheet


I am contemplating using the Smartsheet API to address some of the background activities I need to happen on the sheets that I have access to. I am not committed to any specific Code/language at this stage but have been trying to get my head round json and JavaScript.

I see that using the GET Sheets allows me to see the details of sheets and I can see the options in a Pick list. I have also see code that would allow me to amend an existing entry in a row by changing the option selected.

What I want to be able to do is to run a code and updates the Row Items of the Pick list. Any suggestions/guidance would be very welcome. Thanks for your consideration.


Solution

  • You can update the list of choices available for each cell within a PICKLIST column by issuing an Update Column request and supplying the picklist choices in the options property of the request. For example:

    PUT /sheets/{sheetId}/columns/{columnId}
    {
        "title":"First Column",
        "index":0, 
        "type" : "PICKLIST", 
        "options" :["One","Two"]
    }
    

    The Update Column operation is described here in the docs: https://smartsheet-platform.github.io/api-docs/?javascript#update-column.