Search code examples
google-sheets

Gsheet AppScript ShowModalDialogue no longer displaying HTML hyperlink


My Gsheet AppScript has the following function to create a pop-up with generated output link. This has been working fine for months, but as of last week the hyperlink stopped appearing in the output. I have replaced the url with google.com but can't get any link to appear.

function showAnchor(name,url) {
  var html = '<html><body><a href="'+url+'" target="blank" onclick="google.script.host.close()">'+name+'</a></body></html>';
  var ui = HtmlService.createHtmlOutput(html)
  SpreadsheetApp.getUi().showModelessDialog(ui,"Complete");
}

function test() {
  showAnchor('google.com')
}

https://i.sstatic.net/82Di1LvT.png


Solution

  • You are getting a blank modal dialog due to a known bug in Google Apps Script where you are getting an error related to web app or html. You may see the error message when you right click the blank modal dialog > inspect > console tab.

    The error message you will likely get:

    Uncaught TypeError: vb.X is not a constructor.

    There's a bug report about this on Google's Issue Tracker. Since you seem to be affected as well, you can add a thumbs-up ("+1") to the report to indicate that you are impacted as well and you may subscribe by clicking on the star next to the issue number in order to receive updates. This will help Google prioritize fixing the bug.


    Update: This issue was fixed in the last update of the Issue Tracker.