Failing to post date value to Summary field

我使用python sdk,和我cannot figure out how to post a date value.

Here is a picture of what I am doing. where sum is a dictionary of posting data

image.png

If I am trying to post a formula, I check that my "Posting value" has a equal sign, and then the formula goes there, and it posts fine.

If I am trying to post a direct value (in this case a date), I have not been successful posting.

There are two fields, object_value and display_value, and neither work for posting. The way the data naturally sits if I do a get request is:

image.png

but when I try to post a displayValue :{'objectValue: "DATE", 'value': "12/12/99"}, I get the following error--

image.png

Any idea what format to use to post dates in the python SDK? if not I'll have to use the requests library and see if I can find the format from the Curl command

Answers

  • Genevieve P.
    Genevieve P. Employee Admin

    Hey@ArielDB

    The Smartsheet API needs dates to be formatted inISO-8601format: YYYY-MM-DDTHH:MM:SSZ. Some SDK methods use language-specific Date objects, which require different date formats. (See:Dates and Times in the API Documentation).

    Additionally for a Summary Field, you'll want to use the 'ObjectValue' to then specify theObjectTypeas 'Date'. I was working withanother member on this postto troubleshoot a very similar issue. (I could use Postman to update a date in a Summary Field but they were encountering some hiccups.)

    Let me know if that helped or not!

    Cheers,

    Genevieve

  • ArielDB
    ArielDB ✭✭✭

    Hi@Genevieve P.,


    I followed your instructions, but was unable to get it to work! Here you see the error I get on top, and the code from the Python-SDK on bottom. I tried going into the SDK to read what type it expects, but I couldn't find anything useful. I will say that when I do a curl command with this structure, it works. Likely I will just do this section in Curl, but I'd love to know how to make this code work in Python!

    image.png


  • ArielDB
    ArielDB ✭✭✭
    edited 02/06/23

    我还没有成功,但是我关闭。使用the SDK I posted the Summary Field with the following format:

    {'id':, 'value':ISO-8601format>, 'type':'DATE'}


    It did not throw an error but it also did not update my summary.

  • ArielDB
    ArielDB ✭✭✭

    I did not find success. 'value' is not an attribute in a summary field object, so it doesn't change the field.

    I can post into a summary date field using 'object_value', but it posts as a string, not a date. If ever I try to make it a date type it creates the error that is shown above, or attribute date.value missing

  • ArielDB
    ArielDB ✭✭✭

    I found data/body that works with curl but not with the SDK. I am stumped! Error messages are above the code in the pictures below

    Python SDK:

    image.png

    doing a plain request:

    image.png


  • Genevieve P.
    Genevieve P. Employee Admin

    Hey@ArielDB

    My apologies for missing your follow-ups!

    I've tested this and it should work if you just set theobject_valueto a string with your date. Even though it's sending the content in as a string, the column type is DATE and should parse this data correctly.

    If this doesn't work, can you double check that you're on the latest version of the SDK?

  • ArielDB
    ArielDB ✭✭✭

    hey, you are right that I can post a string into a date type column for some reason. That being said, I have not been successful at having the date string acknowledged by Smartsheet as a date, and have the date widget that comes up when you click a date field to show the correct date.

    ex:

    image.png

    can you give me an example of a string that will post correctly into a date column? Not sure how to format it maybe

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi@ArielDB

    What happens if you try adding the date without the time or timezone designation? The same as in your first comment:

    '2022-01-01T00:00:00Z'

    If this still isn't showing up correctly, can you confirm what version of the SDK you're using?

Widgets { get { return widgets; } set { widgets = value; } } When you update the Sight you get a JSON error. The API documentation states Update is for a dashboard name change - this does work ok. Can anyone confirm whether you can or cannot update…","snippet":"The sight object exposes Widgets as a get and a set. public IList Widgets { get { return widgets; } set { widgets = value; } } When you update the Sight you get a JSON…","categoryID":320,"dateInserted":"2023-08-23T16:10:13+00:00","dateUpdated":null,"dateLastComment":"2023-08-25T02:50:25+00:00","insertUserID":136172,"insertUser":{"userID":136172,"name":"BKing","title":"","url":"https:\/\/community.smartsheet.com\/profile\/BKing","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-25T14:24:11+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":139601,"lastUser":{"userID":139601,"name":"jmyzk_cloudsmart_jp","title":"jmyzk","url":"https:\/\/community.smartsheet.com\/profile\/jmyzk_cloudsmart_jp","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/ZBVD3K8PY0D5\/n7CZ1F4XWEM9Y.JPG","dateLastActive":"2023-08-26T11:19:10+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":45,"score":null,"hot":3385740638,"url":"https:\/\/community.smartsheet.com\/discussion\/109346\/can-anyone-help-with-the-dashboard-api","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109346\/can-anyone-help-with-the-dashboard-api","format":"Rich","lastPost":{"discussionID":109346,"commentID":392512,"name":"Re: Can anyone help with the Dashboard api?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392512#Comment_392512","dateInserted":"2023-08-25T02:50:25+00:00","insertUserID":139601,"insertUser":{"userID":139601,"name":"jmyzk_cloudsmart_jp","title":"jmyzk","url":"https:\/\/community.smartsheet.com\/profile\/jmyzk_cloudsmart_jp","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/ZBVD3K8PY0D5\/n7CZ1F4XWEM9Y.JPG","dateLastActive":"2023-08-26T11:19:10+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-24T07:38:40+00:00","dateAnswered":"2023-08-24T00:17:46+00:00","acceptedAnswers":[{"commentID":392255,"body":"

@BKing<\/a> <\/p>

\n \n https:\/\/stackoverflow.com\/questions\/56711545\/is-it-possible-to-change-widget-data-of-dashboards-through-the-smartsheet-api\n <\/a>\n<\/div>


<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":320,"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":109281,"type":"question","name":"Bridge and FedEx Module - Authentication Problem","excerpt":"I'm getting an authentication connect issue when trying to run the FedEx Module step in my Bridge job flow. I set up a FedEx Developer Account and created a test new project. When I run the Bridge job I get an error on on the Module run saying, \"failed to execute extension module : Authentication Failed\". I mapped the…","snippet":"I'm getting an authentication connect issue when trying to run the FedEx Module step in my Bridge job flow. I set up a FedEx Developer Account and created a test new project. When…","categoryID":320,"dateInserted":"2023-08-22T16:13:19+00:00","dateUpdated":null,"dateLastComment":"2023-08-25T14:18:51+00:00","insertUserID":148855,"insertUser":{"userID":148855,"name":"cabbsman","url":"https:\/\/community.smartsheet.com\/profile\/cabbsman","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!88cq90f5xTs!8sDpd7uL9Ps!kj4X4avpgGN","dateLastActive":"2023-08-25T14:19:44+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭"},"updateUserID":null,"lastUserID":91566,"lastUser":{"userID":91566,"name":"Genevieve P.","title":"Community Manager","url":"https:\/\/community.smartsheet.com\/profile\/Genevieve%20P.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/KHY4Y67W0VRX\/nF76D5N9MFB28.png","dateLastActive":"2023-08-25T20:36:29+00:00","banned":0,"punished":0,"private":false,"label":"Employee Admin"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":53,"score":null,"hot":3385695730,"url":"https:\/\/community.smartsheet.com\/discussion\/109281\/bridge-and-fedex-module-authentication-problem","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109281\/bridge-and-fedex-module-authentication-problem","format":"Rich","tagIDs":[227,369],"lastPost":{"discussionID":109281,"commentID":392578,"name":"Re: Bridge and FedEx Module - Authentication Problem","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392578#Comment_392578","dateInserted":"2023-08-25T14:18:51+00:00","insertUserID":91566,"insertUser":{"userID":91566,"name":"Genevieve P.","title":"Community Manager","url":"https:\/\/community.smartsheet.com\/profile\/Genevieve%20P.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/KHY4Y67W0VRX\/nF76D5N9MFB28.png","dateLastActive":"2023-08-25T20:36:29+00:00","banned":0,"punished":0,"private":false,"label":"Employee Admin"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/G9UB21M8QHGL\/screenshot-28125-29.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot (125).png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-25T14:00:28+00:00","dateAnswered":"2023-08-25T08:23:46+00:00","acceptedAnswers":[{"commentID":392524,"body":"

Hey @cabbsman<\/a> <\/p>

I'm not sure why you're getting the Authentication error, however I don't believe you need to connect to the developer account to track your FedEx parcel! 🙂<\/span><\/p>

Try disconnecting from the developer account and simply click Connect in the Extension:<\/p>

\n
\n \n \"Screenshot<\/img><\/a>\n <\/div>\n<\/div>\n

Hopefully this helps bypass the error. Let me know if that worked for you!<\/p>

Cheers,<\/p>

Genevieve<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":320,"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":227,"urlcode":"api-and-developers","name":"API and Developers"},{"tagID":369,"urlcode":"bridge-by-smartsheet","name":"Bridge"}]},{"discussionID":109267,"type":"question","name":"Is there any way to get a sheetID from the KEY retrieved from a sheet access report?","excerpt":"I am a system admin, and we recently had to let go of our other system admin. I am trying to find out what sheets he had access to that I didn't, so I could could access to those sheets. The only way I can compare what I have access to versus was he had access to was a sheet access report, which has a sheet Key, not the…","snippet":"I am a system admin, and we recently had to let go of our other system admin. I am trying to find out what sheets he had access to that I didn't, so I could could access to those…","categoryID":320,"dateInserted":"2023-08-22T15:06:55+00:00","dateUpdated":null,"dateLastComment":"2023-08-23T14:06:57+00:00","insertUserID":137019,"insertUser":{"userID":137019,"name":"Samuel Mueller","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Samuel%20Mueller","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B9G8B70WXQWC\/nKTI46EH9WQOM.jpg","dateLastActive":"2023-08-25T18:19:58+00:00","banned":0,"punished":0,"private":false,"label":"Overachievers"},"updateUserID":null,"lastUserID":137019,"lastUser":{"userID":137019,"name":"Samuel Mueller","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Samuel%20Mueller","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B9G8B70WXQWC\/nKTI46EH9WQOM.jpg","dateLastActive":"2023-08-25T18:19:58+00:00","banned":0,"punished":0,"private":false,"label":"Overachievers"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":40,"score":null,"hot":3385518232,"url":"https:\/\/community.smartsheet.com\/discussion\/109267\/is-there-any-way-to-get-a-sheetid-from-the-key-retrieved-from-a-sheet-access-report","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109267\/is-there-any-way-to-get-a-sheetid-from-the-key-retrieved-from-a-sheet-access-report","format":"Rich","tagIDs":[227,526],"lastPost":{"discussionID":109267,"commentID":392110,"name":"Re: Is there any way to get a sheetID from the KEY retrieved from a sheet access report?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392110#Comment_392110","dateInserted":"2023-08-23T14:06:57+00:00","insertUserID":137019,"insertUser":{"userID":137019,"name":"Samuel Mueller","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Samuel%20Mueller","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B9G8B70WXQWC\/nKTI46EH9WQOM.jpg","dateLastActive":"2023-08-25T18:19:58+00:00","banned":0,"punished":0,"private":false,"label":"Overachievers"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-23T14:05:46+00:00","dateAnswered":"2023-08-23T13:36:46+00:00","acceptedAnswers":[{"commentID":392096,"body":"

Hey @Samuel Mueller<\/a> <\/p>

They key is something you can provide to Support to help them find the specific sheet down the line, if needed. For your purposes, it can help identify different sheets when they have the same name. <\/p>

Here's more information:<\/p>

\n \n https:\/\/help.smartsheet.com\/articles\/2482665-sheet-access-report\n <\/a>\n<\/div>

Cheers,<\/p>

Genevieve<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":320,"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":227,"urlcode":"api-and-developers","name":"API and Developers"},{"tagID":526,"urlcode":"system-admin","name":"system admin"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=320&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":216,"limit":3},"title":"Trending in API & Developers","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in API & Developers