How to update the value of a summary field if it's text?
We introduced a new process where our team needs to fill in a bunch of summary fields for every smartsheet.
I'm trying to update the data for summary fields using APIs for existing smartsheets as a backfill. I have all the data in a google sheet. I'm using Zapier to make the API call for every row in the google sheet.
I want to use the "Put" method but it doesn't seem to support TEXT_NUMBER.
curl https://api.smartsheet.com/2.0/sheets/{sheetid}/summary/fields -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -X PUT -d '[{
"id": {SummaryfieldID},
"objectValue": {
"objectType": "TEXT_NUMBER",
"value": "Vishnu Test"
},
"index": 0,
"title": "Account Name"
}]'
I'm getting an unsupported type error as shown below.
I'm from the Operations team and I used to be a developer (not that good as you can see).
What am I missing here? Or is this not possible at all?
Best Answer
-
Hi @Vishnu
You don't need to specify the objectType for Text_Number, as this will be specified under Type instead (keep scrolling down the page you screen captured). You can also list the objectValue right away as the value to update the Summary Field, like so:
[{ "id": xxxx, "title": "Title Text", "type": "TEXT_NUMBER", "objectValue": "Test Text" }]
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
Hi @Vishnu
You don't need to specify the objectType for Text_Number, as this will be specified under Type instead (keep scrolling down the page you screen captured). You can also list the objectValue right away as the value to update the Summary Field, like so:
[{ "id": xxxx, "title": "Title Text", "type": "TEXT_NUMBER", "objectValue": "Test Text" }]
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Thanks Genevieve. That worked!!
I didn't try that because objectValue is an object. I tried displayValue instead of objectValue. Should have tried that as well. Thanks again.
-
No problem! I'm glad you were able to get it to work. 🙂
If you have feedback on the API documentation or on the structure, please feel free to fill out this form.
Thanks!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Genevieve P. Sorry to revive an old thread, but I am working with the API to update a Sheet Summary Field that is a Date. When I use the code above I can change the value in the field, but I have a formula in the sheet that then no longer works (apparently because the date wasn't selected using the date picker in the GUI), giving an "#INVALID OPERATION" error. Is there a workaround for this or is it expected behavior?
Thanks!
-
It sounds like you may be inputting the date in a format that's being read as Text in a date cell, instead of a Date. Are you using ISO-8601 format? YYYY-MM-DDTHH:MM:SSZ
See: https://smartsheet.redoc.ly/#section/API-Basics/Dates-and-Times
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Genevieve P. First I just took the value from directly from another sheet (which I obtained in a preceding call), but that didn’t work, so I tried formatting it in various ways. Nothing seems to work, so I’m thinking it has to do with the summary field itself.
-
Would you be able to post a screen capture showing how your different Summary Fields are set up? And post what formula you're using?
I tested updating a Date type of cell in a Summary field to a different date, and it worked as expected. A formula referencing that cell also updated accordingly, without an error.
This was my test body example:
[{ "id": 6423717990426500, "type": "DATE", "objectValue": { "value": "2022-01-01", "objectType": "DATE" } }]
As long as the ObjectType is "DATE" and the Value is formatted correctly, it should be recognized as a date value.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Genevieve P. Thanks for your testing! I've abandoned that field (for now) in favor of cell-llinking directly in the sheet. Your responses have been very helpful!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives