Maggie MM
Maggie MM

Reputation: 19

Google Forms & AppsScript : How to programmatically set "Collect Email Addresses" to VERIFIED

we have a Google Workspace, and in it I have written a script that dynamically generates Google Forms. I want the forms to collect the respondent's verifiable email address. However when I set form.setCollectEmail(true), it defaults the form to "Responder input", i.e the user can enter any email they want, even if they are signed in.

How can I programmatically have the value be "VERIFIED" which automatically logs the logged in user's email?

This behavior seems to be fluid and has changed multiple times since November. I was initially able to force VERIFIED by using the deprecated method form.setRequireLogin(true), but that doesn't work any longer.

Upvotes: 1

Views: 91

Answers (1)

4thAnd1
4thAnd1

Reputation: 856

Make forms automatically collect user email

I had a related case and was able to confirm that its content is still relevant to date.

Alternative script of the .setRequireLogin that changing the collecting email on google form

While on the case on this post, I discovered that various methods available on Apps Script will allow you to have your form collect users's email addresses. Moreover, the kind of email field will vary from the type of account that created the form, whether it's a regular gmail.com account or a workspace account.

References:

Class Froms's deprecated methods

Upvotes: 1

Related Questions