Google Apps 脚本:如何处理动态表单的响应?

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

我编写了一个简单的 Apps 脚本,它执行以下操作:

我现在想做的是处理 Google 使用脚本发送表单提交以发送电子邮件回复。我将如何处理 Google 表单提交,而无需在每次使用上述脚本创建表单时手动附加另一个脚本。

您可能想使用 onFormSubmit 触发器。 指定将在向表单提交响应时触发的触发器。

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

阅读官方文档here