How to update the value of a summary field if it's text?

VishnuVishnu
edited 09/28/21 in API & Developers
09/28/21 Edited 09/28/21
Accepted

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

  • Genevieve P.Genevieve P. admin
    Accepted 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

Answers

  • Genevieve P.Genevieve P. admin
    Accepted 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

  • 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

Sign In or Register to comment.