0
votes

I'm writing a script within (bound to) a Google Form. The idea here is to have the respondent enter their email address in the form (that's the only field in the form) and then make a copy of a spreadsheet (based on a template) and email it to them.

The script is triggered by the submission of the form. At the moment I'm wondering what the easiest way would be to grab that email address out of their response. I have gotten as far as figuring out that it's available within FormApp.getActiveForm(), but I can't seem to find a "getActiveResponse()" method. How do I grab that email address they just entered, without scrolling through every response? If there was a getActiveResponse, then I would just grab the contents of Item 1.

1

1 Answers

0
votes

The Form submit event has the FormResponse property. This property has the method getRespondentEmail()

If the script is triggered by the submit event, you should be able to fetch the email address from there.