0
votes

I have Google apps script with doGet function:

function doGet(e) {
  return HtmlService.createTemplateFromFile('Copy').evaluate();
}

There is string in file Copy:

<span id="label"></span>

I need to change text of this from GS (I have big function and need change text 4-5 times). I tried to find info about doPost()and UrlFetchApp.fetch(), but i don't understand what i need to do to change some text in web app. (and how to use do Post() generally)

I read about templates https://developers.google.com/apps-script/guides/html/templates but they can change text only 1 time, in doGet..

Simply put i need to give user info about status of executing my function.

1
You could use google.script.run.withSuccessHandler to update the status of your function in regular intervals. developers.google.com/apps-script/guides/html/communication - SpiderPig
Check this doGet and doPost Tutorial. The ContentService.createTextOutput method is the most basic way to return content from a GET request but is the building block for most other types of content. The TextOutput objects created by this method returns a response of type, text/plain by default, but can be set to ATOM, CSV, ICAL, JAVASCRIPT, JSON, RSS, TEXT, VCARD, and XML. - abielita

1 Answers

1
votes

You can use the contentService

Google spreadsheet can help you to save data. With your script you can save data on the map and use dom to show the data, or save data on the spreadsheet and display data with SpreadsheetApp.