0
votes

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.

1
do not give others the dev version. try with the one the docs say to give others. also its important you look into the pubkishing mode (run as me, run as user)Zig Mandel
You don't need to bind the Apps Script project to the spreadsheet. If you share a spreadsheet with an Apps Script project bound to it, and if the person it is shared with can make a copy of the file, they can become the owner of the copied file. Then, as owner, they have access to the code. So, if you want to protect the code, be aware of that.Alan Wells

1 Answers

1
votes

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.