Editing/Updating ContactList or Dropdown Items via the API
Hi guys.
We are making good headway pushing data from our CRM to SS with the API with VB and C#.
One of our sheets needs to have a column with a list of (regularly changing) people for the users to select from in a ContactList or Dropdown control. I believe it is not possible to draw these lists from another source sheet for these controls as yet.
This list of people is automatically kept up to date on our SQL server for use locally, so I want to be able to push the updated values/list (clear and rebuild the list), into the actual list of available people in the SS sheet control, for the users to pick from manually.
I am not talking about pushing/selecting values in the cell with the API, but updating the possible selections for the users to pick from.
Is this possible?
If so, any clues please?
Thx.
Best Answer
-
Hi @Jeff Davies
You can update the Contact options in the dropdown list by using Update Column and setting the contactOptions in the column object.
The value for the
contactOptions
property must be an array of objects, where the objects are formatted as follows;{ email: emailAddress, name: name}
Setting this will wipe out the current values, so if you are looking to add new Contacts then you will want to provide a whole new list, including the new values.
Here's the API Documentation for Update Column: https://smartsheet.redoc.ly/#operation/column-updateColumn
Cheers!
Genevieve
Answers
-
Hi @Jeff Davies
You can update the Contact options in the dropdown list by using Update Column and setting the contactOptions in the column object.
The value for the
contactOptions
property must be an array of objects, where the objects are formatted as follows;{ email: emailAddress, name: name}
Setting this will wipe out the current values, so if you are looking to add new Contacts then you will want to provide a whole new list, including the new values.
Here's the API Documentation for Update Column: https://smartsheet.redoc.ly/#operation/column-updateColumn
Cheers!
Genevieve
-
Fantastic @Genevieve P. !
Really appreciate the guidance.
That will save me plenty of time.
Thanks again. : -)
-
I have this working successfully now.😎
Getting the hang of things now.
Thank you once again. 👍
-
No problem! I'm glad you got it working 😎
-
I want to update a dropdown list column which contains "employee status" and also that column contains conditional formatting.
How to do it via API Method
Thanks,
Sandhiya P
-
Hey @Sandhiya07
Here's the updated link to the newer version of the API Documentation for Updating a Column: https://smartsheet.redoc.ly/tag/columns/#operation/column-updateColumn
The request examples in the right panel show how to update a Picklist column with new values.
Cheers,
Genevieve
-
I have tried using this API method, but it looks like there is only a limit of 1000 contacts. I keep on encountering this error:
"errorCode" : 1061,
"message" : "Max count exceeded for field 'column.contactOptions[]'."
Is there a work around for having 1000+ contacts??
Thanks,
Aaron
-
Hey @Aaron Matthew
Contact List column types have a limit of 1,000 contacts that can be added to the column properties, yes. There currently isn't any workaround that I know of to include more in the Column itself.
Keep in mind that contacts that are a part of your My Smartsheet Contacts and your Organization's members will appear as you type in a cell, even if they're not specified in the column itself, see: Manage which contacts appear when you type in a cell
Cheers,
Genevieve