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

Options

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 ✭✭✭✭✭✭
    Options

    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?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Options

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

  • sbryon
    sbryon ✭✭
    Options

    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 ✭✭
    Options

    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
    Options

    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.


  • sbryon
    sbryon ✭✭
    Options

    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.