0
votes

Just need to clarify something and ask for a reference.

  1. App Script Execute within the spreadsheet works fine with all the example. but.
  2. when appscript is deployed as webapp using scriptEditor -> publish -> Deploy as Webapp most of the code in appscript is not working.

ex: using script editor create a form using builder create a doGet() function and show the form bind some function to button?

can anyone point me to a reference like opening the spreadsheet where the form is within and manipulating cell values.

can you please give me information where can i get reference for scripting on forms as webapps.

Thanks

2

2 Answers

4
votes

The main difference between these 2 modes when accessing a spreadsheet is that the web app does not know the spreadsheet it is linked to unless you tell it explicitly, there is no such thing as 'active spreadsheet' or 'active sheet'. So you should open the spreadsheet by ID (openById('long ID number') and choose the sheet by its name or index.

The other point, but I guess this one you'll find it obvious, is that UI functions attached to spreadsheet must end by "var doc = SpreadsheetApp.getActive();doc.show(app);" and web apps only by "return".

There are many examples on the web, some are available on Google Developpers or also here , hope you'll find some interesting ideas.

0
votes

There are few more difference you might get in webapp like when you use it u might not able to use some classes that are limited to appscript only like: when you creating a page u cannot use Logger.log() instead you can use console.log() and see logs by inspect element > console > bottom.

web app allow us to use html, css, javascript to build web pages