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.
google.script.run.withSuccessHandlerto update the status of your function in regular intervals. developers.google.com/apps-script/guides/html/communication - SpiderPigContentService.createTextOutputmethod is the most basic way to return content from a GET request but is the building block for most other types of content. TheTextOutputobjects 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