Reputation: 88
I'm quite new Google Scripts. I'm trying to create a web app through which users can log in (with their Gmail accounts) and modify a Google Sheet. Here's a screenshot of the registration page.
Initially, the user logs in via their existing Google account and this page is displayed. Upon clicking the button, what I want is for the script to add their submitted information and their current email to a Google Sheet. Once their info is in the Sheet, they only need to log in via Google to gain access to the system. However, when I try this with another account I get this error:
Is this a permissions problem? Or does Google Scripts not allow this kind of direct manipulation of files on my Drive? Here are my permissions settings for my web app:
Is this at all possible?
Upvotes: 0
Views: 438
Reputation: 201358
From your question, I could understand that the settings of your Web Apps is as follows.
Execute the app as: User accessing the web app
Who has access to the app: Anyone
For above Web Apps, you want to make users access to the Web Apps using each browser.
From above situation, please confirm the following points. At first, I think that when the Spreadsheet you want to put the values is in each user's Google Drive, no error occurs. So from your question, I thought that the Spreadsheet might be in your Google Drive.
getActiveSpreadsheet()
is used, it is required to share the Spreadsheet with the user.
If you don't want to share the Spreadsheet with the user, how about the following workaround?
Execute the app as: Me
Who has access to the app: Anyone, even anonymous
Who has access to the app: Anyone
is used, it is required to share the script of new Web Apps with the user. So I proposed to use Anyone, even anonymous
for this situation.Upvotes: 2