Google Apps 脚本:如何处理动态表单的响应?
Google Apps Script: How to handle responses of a Form that was dynamically?
我编写了一个简单的 Apps 脚本,它执行以下操作:
- 创建一个 Google 表单,并通过验证相应地填充它的字段。
- 创建文件夹并将其上传到 Google 驱动器。
- 创建电子表格文件并将其上传到上面创建的文件夹中。
我现在想做的是处理 Google 使用脚本发送表单提交以发送电子邮件回复。我将如何处理 Google 表单提交,而无需在每次使用上述脚本创建表单时手动附加另一个脚本。
您可能想使用 onFormSubmit 触发器。
指定将在向表单提交响应时触发的触发器。
var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
ScriptApp.newTrigger('myFunction')
.forForm(form)
.onFormSubmit()
.create();
阅读官方文档here。
我编写了一个简单的 Apps 脚本,它执行以下操作:
- 创建一个 Google 表单,并通过验证相应地填充它的字段。
- 创建文件夹并将其上传到 Google 驱动器。
- 创建电子表格文件并将其上传到上面创建的文件夹中。
我现在想做的是处理 Google 使用脚本发送表单提交以发送电子邮件回复。我将如何处理 Google 表单提交,而无需在每次使用上述脚本创建表单时手动附加另一个脚本。
您可能想使用 onFormSubmit 触发器。 指定将在向表单提交响应时触发的触发器。
var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
ScriptApp.newTrigger('myFunction')
.forForm(form)
.onFormSubmit()
.create();
阅读官方文档here。