sas*_*amp 9 javascript google-apps-script google-forms
我有一个附加到 Google 表单的脚本,该脚本在提交时向 Discord 频道发送通知。我想包含一个指向个人回复的直接链接(链接看起来像https://docs.google.com/forms/d/<myformid>/edit#response=<responseid>)。我怎样才能找回那个链接?我得到的链接最多的一部分,/edit与Form.getEditUrl()但我不能得到正确的ID。我检查过,FormResponse.getId()但这并没有将我与任何回复联系起来。
由于您知道响应 ID,因此可以使用 geEditResponseUrl 方法获取表单响应的直接链接。请注意,知道此 URL 的任何人都可以编辑响应。
function getEditUrl(responseId) {
var form = FormApp.getActiveForm();
var response = form.getResponse(responseId);
return response.getEditResponseUrl()
}
Run Code Online (Sandbox Code Playgroud)