2

When I attempt to set the Finish column on a row in a sheet via the SmartSheet API, I get the following message:

{
    "errorCode": 1080,
    "message": "End Dates on dependency-enabled sheets cannot be created/updated. Please update either the Duration or Start Date column.",
    "refId": "19ufon4xzsn7y",
    "detail": {
        "index": 0,
        "rowId": 4987804240111492
    }
}

If I want to clear the project dates for a specific row I can set the Duration and Start columns to null, but the Finish date remains. See https://smartsheet-platform.github.io/api-docs/#update-rows

What is the programmatic way to clear the project dates, including Finish, for a row?

2 Answers2

1

I was able to update the Finish Date programmatically on a dependency enabled sheet via the API.

In order to do so I had to pass the date string in their specified format, and populate the strict property = true on both of the Start Date and Duration cell objects.

Using C#, you can get the date string formatted correctly using this code: startDate.ToString("O")

Mark Iannucci
  • 135
  • 3
  • 11
0

I don't believe it's possible to programmatically update Finish date whenever dependencies are enabled for the sheet. Note, this is the sheet setting (in the Smartsheet UI) that specifies dependencies are enabled for a sheet:

enter image description here

If I manually uncheck this box and save the change via the Smartsheet UI, then I'm subsequently able to successfully update Finish dates via the API. Unfortunately it doesn't seem possible to disable dependencies for the sheet via API (i.e., the programmatic equivalent of unchecking this box). I tried doing so, but received an error indicating that you cannot set the dependenciesEnabled property via API.

REQUEST:

PUT /sheet/{sheetId)
{
   "dependenciesEnabled": false
}

RESPONSE:

{
    "errorCode": 1032,
    "message": "The attribute(s) sheet.dependenciesEnabled are not allowed for this operation.",
    "refId": "10pl3li0rs9b"
}
Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • Thanks, Kim. Additionally, when disabling dependencies in the sheet, the Duration column becomes a normal Text/Number field and no longer supports duration values, such as “10d”, “2w”, etc. – Rick Moerloos Dec 15 '20 at 02:59
  • @Rick - thanks for pointing this out. The behavior you've described is consistent with what I'd expect. "Dependencies Enabled" is what makes a sheet a "project" sheet (i.e., tells Smartsheet to treat the data like a project plan, with dependencies, durations, start dates, end dates, etc.). If dependencies is disabled, Smartsheet will no longer treat the data like a project plan, so any *special* column types and auto-calculations that happen for those special columns in a project sheet will no longer be present. – Kim Brandl Dec 17 '20 at 01:09