I would like to be able to click on a button on my main.html form in an Web App Google Apps Script to go to another html page.
But how do I implement this with the doGet() function:
function doGet() {
var clientss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/P4ZgBlgYZYHH8Ga3HHs/edit#gid=0");
var clientws=clientss.getSheetByName("Clients");
var htpage=HtmlService.createTemplateFromFile("NewJob");
var clientlist = clientws.getRange(2,1,clientws.getRange("A2").getDataRegion().getLastRow(),5).getValues();
htpage.clientlist=clientlist.map(function(r) {return r[0];});
return htpage.evaluate();
}
Multi Page Web App
This is working basic four page webapp. It only displays the page title and four buttons on the left sidebar for navigation.
Code.gs:
Pages.gs
I decided to switch to user scripts properties service since you may want to have more that one user. I often develop scripts that only I use.
globals.gs:
I was using this for the page title but decided that some of you may wish to have multiple users and so user properties service is a more logical selection. I'll probably use this for something else so I left it in. But your call.
Page1.html:
1 of 4. They start out the same. I make them this way and if I need to customize them I'll usually just do it right inside the html page. But it's also possible to add additional javascript or css pages to support variations from page to page.
content.html:
css.html:
A very simple styles page.
res.html:
Here's what one of the pages looks like.