1

I just started learning Google Scripts 3 days ago and was tasked to create a data entry program. I am trying to create a data entry program where inputting the data in the web app will automatically log the data inputted in the Google Spreadsheets. I have successfully created one but I need to create another one for a different type of data but I also need it to be in the same sheet.

I have tried creating my Index.html as the homepage with two buttons which should link to the other two htmls I have created but using doesn't seem to be working as it just tells me that the file does not exist or cannot be accessed. I have looked into some references but I cannot understand some of the important parts or does not explain much.

references: Where I Learned Google App Scripts

Linking to another HTML File

How to use google script web app with multiple pages in google site?

TheMaster
  • 45,448
  • 6
  • 62
  • 85
uishauvei
  • 13
  • 3
  • On second thought, although my answer is a perfect fit for the question, you might not need two webapps. If don't need two end points, but just two webpages, ask a new question with your code as [mcve] – TheMaster Mar 07 '23 at 14:02
  • @TheMaster It was okay, it was perfectly what I needed. – uishauvei Mar 08 '23 at 08:48

1 Answers1

0

Yes, it is possible. One project can have only one doGet or doPost function. Therefore, in one project, you can only have one web app. However, you can have more than one project bound to a spreadsheet. This used to be easy in the old editor, where you just had to go to File > New Project. But, with the new editor, this doesn't seem to be possible manually. You can however do it with Apps script api or a wrapper around that api, namely .

In a new folder, create the project

clasp create --parentId ID_OF_THE_SPREADSHEET

Then go to another folder and do the same command with the same parent id. If that goes well, you'll have two independent projects bound to the same spreadsheet. Now, you can have two doGet and therefore have two webapps. You don't need clasp/terminal anymore, after this initial step, but it'll help a lot, if you use it though.

TheMaster
  • 45,448
  • 6
  • 62
  • 85