0
votes

I have created a Google Form and a Google Sheet to save the responses. I have a requirement that the form should only be filled by the users with the given email addresses only (email address stored in another sheet). So, is there a way I can match the Session.getActiveUser().getEmail() with the email address list before rendering the Google Form?

I have already enabled following options:

  • Collect email address
  • Restrict to users in organization

As an alternative I am thinking to embed the Google Form in email so user won't get the actual link of the form, so is it possible to embed existing Google Form by providing the ID of the form and send it to the list of email address using App Script?

Please guide. Thanks in advance.

1
Even if you do that what keeps you users from sharing the link. Just delete the responses from users not on the list. I’d give the person that’s going to do the final review of the data the script and they run it once and they’re done. Its a simple matter of putting all of the emails in an array and using indexOf() ... delete the ones that return-1Cooper
We won't prevent users from sharing the link, that is exactly why we want to authorize users before rendering the form for them. . .user2517610
I would use a web app.Cooper
Yes, we would deploy app script as a web app, but I have no idea how will I achieve this requirement using web app. Would be highly appreciated if you plz guide me in this regard.user2517610
I couldn't find any validations that woulld be suitable for your needs . The only way I can see to do this is with a webapp and a standard html solution. But that would be pretty complicated to explain in this forum. If you want assistance perform thing you can contact me through my profile.Cooper

1 Answers

1
votes

From the question:

... So, is there a way I can match the Session.getActiveUser().getEmail() with the email address list before rendering the Google Form?

No, there isn't.

There are many options

  1. Share the form view link to only the allowed users
  2. Embed the form in a Google Site and share the site only with the allowed users
  3. Set the validation after the form is submitted (you coud do this by using form or spreadsheet on form submit installable trigger
  4. Forget about using Google Forms and use other thing to create your form (you could create a web application by using Google Apps Script)
  5. ...