Delete/Remove/Clear Hyperlink using API

Options
GarrettSever
edited 05/07/24 in API & Developers

While there are a wealth of articles, discussions, and examples of adding and updating hyperlinks in cells using the Smartsheet API, I struggled to find any concrete guidance on how to remove a hyperlink or clear a cell that contains one via the API. I need the equivalent of going into the sheet, hitting "Delete" in the cell, and then saving, but this does not seem possible via the API.

I have tried:

  • Passing both empty strings and Null values to the cell's "value" and "displayValue" fields.
  • Passing a "hyperlink" property value of Null as well as a "blank" hyperlink
  • Passing a "hyperlink" object with an empty string and Null value for the "url"
  • Passing a "hyperlink" object with a 0 and Null value for a "sightId"
  • Various combinations of the above.

Some of these return "Success," but the hyperlink remains, and some throw various 11## errors stating the hyperlink url, sheetId, or reportId values must be specified.

I'm perplexed by the apparent lack of a method in the API to remove or delete a hyperlink. If my approaches are incorrect, I'm eager to learn what specific values I need to pass through the API for the hyperlinks to be removed. Could someone shed some light on this?

Answers

  • Genevieve P.
    Genevieve P. Employee Admin
    Options

    Hi @GarrettSever

    Historically this was possible by passing an empty string as the cell value: "value": ""

    However using this I see the same thing that you're experiencing (a "success" statement but with no changes to the cell). I don't believe this is expected, but I'm unsure what changes may have been made. I see that you have already posted a Product Idea regarding this, thank you! I'll pass that feedback along to the product team.

    Cheers,
    Genevieve

  • GarrettSever
    Options

    Thank you Genevieve! It is appreciated.