HTML Output to download file in Google Sheets stopped working suddenly

Skip to first unread message


Jan 20, 2022, 12:33:10 PMJan 20
to Google Apps Script Community
Hey everyone, I'm pretty new here so I hope I'm not doing anything wrong

I'm posting here because for an unknown reason, and I know that I'm not the only one to experience it, HTML outputs in google sheets seem to have been subject to a change that makes some things in them not working anymore.
More specifically with clickable download links in HTML outputs.

Here's the simple code :
function showurl(url)
  var htmlOutput = HtmlService.createHtmlOutput('<a href="' + url + '">On this link</a>').setWidth(250).setHeight(250);
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Download the JSON');

With our workflow, the script creates a JSON from the Google Sheet that it puts in a Google Drive folder and then proceeds to get its download link and display it on the HTML output so we can download it directly.
It was working super well before, but for some reason, without any modification, it stopped working recently and instead we get an error in the HTML output when we click the link. Does any of you have an idea why or a way to fix this?

Screenshot_1.jpg Screenshot_2.jpg

Thanks in advance

Reply all
Reply to author
0 new messages