0

Filter and generate results from spreadsheet in Web App

In Google scripting i found a way to deploy a web app. Is it stable enough for it be deployed as a web app all the time and also to be accessible from anywhere. I have a lot of confusions regarding this. Also the main starting issue iam faced with is the usage of this query>

 var ss = SpreadsheetApp.getActive();
 var sheet = ss.getActiveSheet();

In the web app how does the var ss gets the specific Spreadsheet from the drive if i have more than 1 spreadsheet. How to specifically point to a single specific spreadsheet

So, to sum up i have these confusions:

  • Using the link which comes after publishing as web app- can it be used without any issues
  • How to specifically point ouut a single spreadsheet if i have multiple spreadsheets.

Please guide me on this.

tony Stark
  • 53
  • 3
  • 14

1 Answers1

-1

Each file in Google Drive has a unique ID assigned to it.

enter image description here

You can copy this ID and call the corresponding method of the SpreadsheetApp class to access the file like so:

  var ss = SpreadsheetApp.openById(FILE_ID);

Alternatively, you can simply copy the URL to the file and use another method of the SpreadsheetApp to get the file by URL:

var ss = SpreadsheetApp.openByUrl(FILE_URL);

Of course, this will work only if you have access to the file. It's too bad that you chose not to follow my advice here about reading GAS documenation first Button Action to retrieve data from spreadsheet using google app script

The usage of SpreadsheetApp class is very well-documented by Google https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app

Not sure what you mean by app stability. If you publish the app to execute as 'you', you may hit the service quotas set by Google. If your app will execute as the user who accesses the app, it will not count against your quota, however, it may lose access to the shared resource.

enter image description here

Ultimately, it depends on what you want to achieve.

Anton Dementiev
  • 5,451
  • 4
  • 20
  • 32