I am trying to publish a spreadsheet as a web app through the script code embedded in another spreadsheet.
Thanks to Tanaike's help I wrote this code:
// Copies the spreadsheet
var repliesFile = responseTemplate.makeCopy('risposte', newFolder);
// Publish the spreadsheet (Drive Api is enabled)
Drive.Revisions.update({published: true, publishedOutsideDomain: true, publishAuto: true}, repliesFile.getId(), 1);
var webAppUrl = "https://docs.google.com/spreadsheet/pub?key=" + repliesFile.getId();
Problem: using webAppUrl I can see the published spreadsheet but what I want is the html returned by the doGet() function in the copied spreadsheet. In a few words, the same interface I get if I publish the web app via 'Publish -> Deploy as Web App'. Is there a way to get it? A few images are attached (don't mind the template variables in the html template).
Thanks for all the help you can give me!
ScriptApp.getService().getUrl()
Note that this method will only work once you deployed the script as a Web App. And the WebApp will only work as intended if it contains a doGet()
function.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.