Monkey
Monkey

Reputation: 11

Google Script onFormSubmit()

I would like to autorun a script in the responses file for a Google Form whenever there is a submission to a Google Form. It works if I run it manually but it cannot be run upon new submission. Anyone advice?

function onOpen(e) {
  var ss = SpreadsheetApp.getActive();
  var form = FormApp.openById('1xuCZFmUEhbkZtUUU0bRS7HOHCerRfd2ebqc3OWPWr5Q');

  ScriptApp.newTrigger('onFormSubmit').forSpreadsheet(ss).onFormSubmit()
    .forForm(form)
    .create();
}

Upvotes: 0

Views: 454

Answers (1)

Maciek
Maciek

Reputation: 131

You don't need to create new trigger every time you open the spreadsheet. Maybe try to manually configure the installable trigger instead.

You will find step-by-step instructions Here

But be aware of the limitations

Upvotes: 1

Related Questions