how to delete broken link_out's

we run a large number of projects (200+) that bubble up to a portfolio via control center / blueprints; i have approx 30 projects whose 'project metric' sheets have broken / inaccessible link-outs; in most cases, they have a correct link-out to the portfolio summary sheet, but the broken links are a lot of "noise" that i am trying to clean up.

we use the python sdk to automate / script our way around the ecosystem, and it works well.

however: i don't see a method anywhere for removing link-outs; sure, i can iterate over rows / cells and get a list of all the linkOutToCells, but i don't see a way to remove any. with status not 'ok' -- is it as simple as creating / copying new cell objects, disregarding the broken links, and updating the sheet via add_row?

Answers

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi @Michael Merwitz

    From the API, you will need to do this from the sheet where the links are coming in rather then going out.

    This means you'd have to go to destination sheets for the broken links and remove them there by deleting the inbound link. The only problem, of course, is that if you're outbound links are broken the API may or may not have the sheetId that's being linked to. In some cases it will, but in many it won't.

    For example, if "Project Metric" sheet is linking out to a sheet called "Project Plan", you would have to go to "Project Plan" and delete the inbound links there, rather than deleting the outbound links from "Project Metric."

    I hope that helps!

    Cheers,

    Genevieve

  • Michael Merwitz
    edited 02/28/24

    thanks.. i figured out that there is only a 'link out' api function, so it answers part of my question -- however, in a number of cases the link-in has a value of 'broken' rather than a sheet name / id, so i can't get back to the original sheet

    e.g. the link data is "{'status': 'BROKEN'}"

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi @Michael Merwitz

    If it's a broken link in that you no longer want or need, you could set the value property to the current value or clear out the cell.

    Cell-linked cells will have both the value property and the linkInFromCell property. If you want to clear the cell link, you can either set the value property to the current value (and omit the linkInFromCell) to retain the current value but remove the cell link, or you can pass empty string as the value to completely empty the cell.

    However if you're talking about a broken link out that doesn't have the sheet ID it's going to, then there won't be a way to remove that from the cell with the outbound link.