0
votes

I have written a simple Apps Script, which does the following:

  • Creates a Google Form, and populates it's fields accordingly with validation.
  • Creates a Folder and uploads it onto Google Drive.
  • Creates a Spreadsheet File and uploads it into the Folder created above.

What I want to do now is handle Google Form submission using the script to send email responses. How would I go about handling Google Form submissions without having to manually attach another script every time I create a form using the above mentioned script.

1

1 Answers

1
votes

Probably you want to use the onFormSubmit trigger. Specifies a trigger that will fire when a response is submitted to the form.

var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
ScriptApp.newTrigger('myFunction')
  .forForm(form)
  .onFormSubmit()
  .create();

Read the official documentation here.