Add Date Value to iSheet

27239

I'm trying to add a date value to a date field in an isheet.

I'm using the /3/isheet/{isheetid}/items/{itemid} REST API call, and am passing the iSheet column values in a payload object.

I am able to write to text fields, but I can't seem to write to date fields.  I checked the iSheet and the date field I'm trying to update is date only, with a MM/DD/YYYY date format.  In the payload, I'm populating:

{
  "recordcount": "1",
  "data": {
    "item": [
      {
        "itemid": "15962",
        "column": [
          {
            "rawdata": {
              "value": "01/01/2020",
              "date": "01/01/2020",
              "time": "00:00:00",
              "choices": null

            },
            "attributecolumnid": 9459
          }
       

      }
    ]
  }
}

Any idea what I'm doing wrong?

]]>
  • Chuck Rothman, the JSON in your post looks more like the output JSON from the GET (/api/{version}/isheet/{isheetid}/items/{itemid}) method.

    For the PUT, the payload JSON should look something more like this:

    {
      "data": {
        "item": [
          {
            "itemsequence": 1,
            "alerteroption": 1,
            "column": [
              {
                "attributecolumnid": 9459,
                "rawdata": {
                  "date": "06/14/2022"
                }
              }
            
    } ] } }

    And where alertoption is:

    // RESPECT_USER_PREFERENCE: 1
    // SEND_NOW: 2
    // SUPPRESS_ALL: 3
    

    Andrew

    ]]>
  • I tried your json and got a bad request. According to Swagger, the json I listed in my original post is correct, and it works to update text fields. It just doesn't work to update date fields.

    When I use:

    {
      "recordcount": "1",
      "data": {
        "item": [
          {
            "itemid": "15962",
            "column": [
              {
                "rawdata": {
                  "date": "01/01/2020"
                },
                "attributecolumnid": 9459
              },
              {
                "rawdata": {
                  "date": "12/31/2023"
                },
                "attributecolumnid": 9460
              }
           

          }
        ]
      }
    }

    I get a response code of 200 (success), but the dates do not appear in the fields. If I convert the columns to text, they appear.

    ]]>
  • Chuck Rothman, strange because it worked for me.

    • Are you using the ..../showSwaggerUI.action#/ISheet%20Module/editIsheetItem swagger endpoint to test?
    • check your columns (9459, and 9460) have correct date format settings

    "recordcount" and "itemid" in your example aren't needed in this context.

  • I can't find editIsheetItem in the isheet module section of Swagger.

    Do you mean /{version}/isheet/{isheetid}/items/byexternalid/{externalid}?

    I am using /{version}/isheet/{isheetid}/items/{itemid}

    I confirmed the date format.