0

I am trying to build web app based on Google Sheets. But for the interaction with user I need more then one HTML page.
The first one is easy to get:

function doGet() {
  return HtmlService.createHtmlOutputFromFile('Index');
}

But based on the response from the first page, I need to show the second page for detailed information.
For example: the first page is for log-in; the second page is for ordering.
How to run the:

HtmlService.createHtmlOutputFromFile('Index2');

Any help appreciated.

Peter

Marios
  • 26,333
  • 8
  • 32
  • 52
Peter
  • 1
  • 2
    Multipage webapp example: https://stackoverflow.com/a/55770563/7215091 – Cooper May 23 '20 at 23:33
  • 1
    Does this answer your question? [Linking to another HTML page in Google Apps Script](https://stackoverflow.com/questions/15668119/linking-to-another-html-page-in-google-apps-script) – Rubén May 24 '20 at 00:03
  • Thank You a lot! I found answers for the same problem; for me the most clear are: [link] https://stackoverflow.com/questions/16879144/google-app-more-than-one-html-or-script-file-in-the-the-same-app-project?noredirect=1&lq=1 and [link] https://stackoverflow.com/questions/41156292/google-apps-script-switching-html-files?rq=1 – Peter May 27 '20 at 05:56

1 Answers1

0

Add page to query string.

function doGet(e) {
  if(e.paramenter.page) {
    return HtmlService.createHtmlOutputFromFile(e.parameter.page);
  }else{
    return HtmlService.createHtmlOutputFromFile('Index');
  }

}
Cooper
  • 59,616
  • 6
  • 23
  • 54