【发布时间】:2020-10-21 15:47:13
【问题描述】:
我有两种不同的形式。它们中的每一个都连接到同一个电子表格。我还设置了一个 onFormSubmit(e) 触发器。现在我的问题是如何根据表单区分表单提交。我对这两种表单都有不同的逻辑,所以我需要获取一些标识符,通过它我可以检查要运行的代码?
function onFormSubmit(e) {
// something like this
// if submission from FormA then do foo()
// else if submission from FormB then do bar()
}
【问题讨论】:
-
相同的电子表格但不同的工作表 - 你不能只使用例如
SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]和SpreadsheetApp.getActiveSpreadsheet().getSheets()[1]来分别获取每个表单响应的工作表吗?
标签: google-apps-script google-sheets google-forms