使用 FormResponse.getEditResponseUrl 时无法编辑您的响应错误

you cannot edit your response error when using FormResponse.getEditResponseUrl

我创建了一个表单,提交者在提交后不能编辑。我附上了一个 on form submit event and in that function I email the FormSubmission.getEditResponseUrl() 值。

function onSubmit(e) {
  MailApp.sendEmail(e.response.getRespondentEmail(), "form test", e.response.getEditResponseUrl());
}

该功能有效——它发送带有 URL 的电子邮件。但是当他们点击 link 时,他们得到错误:

You cannot edit your response

Responses to this form cannot be edited. Try contacting the owner of the form if you think this is a mistake.

我的理解是 getEditResponseUrl() 生成的 URL 让他们编辑 FormResponse 即使 Form 设置为 not 让他们编辑。

我做错了什么吗?看到这个我快要疯了。

来自艾伦·威尔斯 #11 reply by a Googler to the issue linked

The engineering team determined that the root cause of this issue was an intentional change around how edit URLs work. Although we rolled back this change temporarily, we will roll it forward again soon.

Specifically, today you can use an edit URL even if the form has the "Edit after submit" setting turned off. We don't think this respect's the form owner's intent and made a change to prevent edits unless that setting was enabled.

In our first attempt at this change we directed users to a blank edit page, which was confusing and made people assume there was a bug. The next time we roll this change forward we will instead redirect users to an error page that makes the situation more clear.

When this change rolls forward, it will likely break some scripts and add-ons again.

同样post包括要做什么:

There are two things that can be done to prevent this:

1) Enable the "Edit after submit" setting manually on forms that you wish to with this feature.
2) In your Apps Script code, use the setAllowResponseEdits() method to enable that setting when you know your code requires it.