I want to use a Google Form to populate a Google Spreadsheet. One of the fields is email address, and I need to validate this against the list of emails for our organisation - in other words forcing people to use valid and existing email addresses.
Our organisation uses Google Apps. The form will be created by a user who is in our organisation and only email addresses from our organisation/domain will be considered valid.
You don't need a script. Simply add a response validation to the question. In the first field, choose "text"; in the second field, "contains"; in the third field, "@'yourdomain'"- that's it!
You can use the experimental Apps Script Domain Services API. Here's how I'd do it.
This is not a Google Apps Script question, but when you create the form, you can select a check box that says "Automatically collect respondent's username. "
Now you can put a Regular Expresion in the field:
For EMAIL:
Email Address – the regex below should match most common email address formats, including Gmail aliases that accept the “+” sign but there’s no perfect solution.
You can use like:
For More Regex: Useful Regular Expressions for Validating Input in Google Forms
Thank you.