codez
codez

Reputation: 1532

Google Apps Script: How to handle responses of a Form that was dynamically?

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

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.

Upvotes: 0

Views: 114

Answers (1)

jbra95
jbra95

Reputation: 909

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.

Upvotes: 1

Related Questions