Is there a way to remove Predecessors from a row via the API in c#?

Using the API I am able to add and update the predecessors column. However, I am not able to remove it via API. I tried by passing a rowId as 0, but that returns an invalid, which populates the column with #REF for that that.

Is there a way to remove or delete Predecessors using the api?

Below is the code I tried to pass rowId as 0. What is the workaround for this?

{
  "cells": [
    {
     "columnId": xxxxxxxxxx,
     "objectValue":{
         "objectType": "PREDECESSOR_LIST",
         "predecessors": [
                {
                    "rowId": 0,
                    "type":"FS"
                }
              ]
          }
    }
     ]
}

Thank you

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Have you tried passing a blank for the rowId and the type? Or maybe using the current rowId that your pulling the info from (so same rowID) and passing a blank type?

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Have you looked into how to clear a cell in general instead of trying to remove a predecessor?

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • sbryon
    sbryon ✭✭

    Hi Paul, I believe rowId needs to be a number, but I'm ok with trying, I'll also try blank type, since I haven't try that yet. Thanks.

  • sbryon
    sbryon ✭✭

    Hi Paul, I tried all scenarios you suggested but nothing worked.

    Tested blank rowId, it didn't work, since it needs to be numeric. Tested using the current rowId, this didn't work, it returns a circular dependency which resulted in the same #REF. Tested blank type, this didn't work, it failed with the following error "updating Type is not permitted." something like that.

    If you think of something else let me know.

    Thanks

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 05/05/23

    I haven't looked into clearing a cell using the API, but I feel like it should be possible. Maybe clearing the cell completely instead of trying to manipulate the predecessor data might work?


    At the bottom of this table it indicates that the Predecessor cell value is a string (comma delimited), so I feel like being able to clear it out should be possible.

    Trying to provide a hyperlink to the table. Hopefully THIS works...



    You can also use a Clear Cell automation built into the sheet to remove predecessors if there is a certain trigger within the sheet that can be used. Quite possibly the same trigger you are wanting to use for the API. And that would probably be easier to set up.


    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • sbryon
    sbryon ✭✭

    Thanks Paul, it is working. I think it's the same idea you had here. I passed a new empty cell with nothing but the Predecessor column Id and that works nicely.

    Thank you very much.