Setting Contact column to Placeholder using the API
![hiker360](https://us.v-cdn.net/6031209/uploads/defaultavatar/nWRMFRX6I99I6.jpg)
I am programmatically updating a sheet using the SmartSheets API. I need to set a column that is a CONTACT type to a Resource Manager placeholder. When I do, I get the error message "The value for cell in column 6143599851818884, did not conform to the strict requirements for type CONTACT." Typically a contact can be set using the email address. However placeholders do not have email addresses so I attempt to set the placeholder text.
As an FYI, the field I'm trying to set is the Assigned To which is used in the RM integration.
When I look at the raw data for an existing value containing a placeholder it looks like
{
"columnId": 6143599851818884,
"value": ".NET Placeholder"
}
Where as a typical user looks like
{
"columnId": 6143599851818884,
"value": "joshua.user@company.com",
"displayValue": "Josh User"
},
Using the APIs, how can I set the column value to the placeholder text?
Answers
-
Try adding the
overrideValidation = true
in the query parameters, and within the cell object addstrict = false
-
Good idea. Unfortunately still didn't work. Still get the error: The value for cell in column 6143599851818884, did not conform to the strict requirements for type CONTACT. Smartsheet support said that what I wanted to do was not supported.
-
@hiker360 I did the below workaround using API python. THe Contact List was just too complex and not flexible for me to work with.
Column A is my picklist and column B is a cross-sheet reference to the directory to capture email. As new records are registered in the sheet directly or via a form, I have automation in place to send update emails as specific information is updated or nearing a deadline.
First, I get the Column ID info.
import smartsheet
smartsheet_client = smartsheet.Smartsheet('INSERT TOKEN')
action = smartsheet_client.Sheets.get_columns(SHEET ID, )
columns = action.data
for col in columns:
print(col.title)
print(col.id)Then, I update Column A to a picklist with options.
import smartsheet
smartsheet_client = smartsheet.Smartsheet('INSERT TOKEN')
column_spec = smartsheet.models.Column({
'type': 'PICKLIST',
'Options': [
"INSERT NAME 1",
"INSERT NAME 2",
"INSERT NAME 3",
"INSERT NAME #"
]
})
response = smartsheet_client.Sheets.update_column( SHEETID, COLUMNID, column_spec)
updated_column = response.result
So far, I have not hit a ceiling as my records < 1K.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.1K Get Help
- 348 Global Discussions
- 199 Industry Talk
- 427 Announcements
- 4.4K Ideas & Feature Requests
- 133 Brandfolder
- 127 Just for fun
- 127 Community Job Board
- 455 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 282 Events
- 36 Webinars
- 7.3K Forum Archives