Dorik
Dorik

Reputation: 43

How to let users access data from a Google Sheet from a Google Apps Script web app?

Background

I am creating a web app in Google Apps Script that allows a user to view data from a Google Sheet and filter the data.

Problem

My problem is somewhat similar to the question posed here. I have shared both the spreadsheet and the web app project with one of the users and allowed them access to the development version of the web app.

The app works for me, however, when the user uses the app, they can see no data from the spreadsheet, indicating they somehow lack access to the spreadsheet. Do I need to associate the web app script with the spreadsheet to allow the user access to the data? I was hoping to keep the web app project and spreadsheet separate.

Also, I understand that I should use the published version of the web app with the exec link when linking users. For now, I was just seeing if an outside user could use the app properly.

Edit: I set the app to execute as me and the access permission set to anyone. When I published the app, I only updated the same version (version 1). Changing the version number to a new version seemed to make the execution and access permissions work correctly. Now the web app is fine.

Upvotes: 0

Views: 3877

Answers (1)

Ihor Husar
Ihor Husar

Reputation: 86

There is not enough info given. What type of permissions did you use when you have deployed the app?

Users who are not currently logged in to their Google account but are accessing your app are viewed as anonymous. To give them a right to see data you should choose Anyone, even anonymous in the menu who has access to the app when you deploy it as a web-app.

Now, to let anyone access to script, both signed in people who don't have permissions to the spreadsheet and anonymous users, you should choose execute app as Me(whatever you e-mail is).

More detailed official guide.

Upvotes: 1

Related Questions