如何添加“编辑回复"链接到 Google 表单电子邮件? [英] How to add "Edit Response" link to Google Forms emails?

查看:24
本文介绍了如何添加“编辑回复"链接到 Google 表单电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 Google 表单,用于收集数据,并使用 AppScript 向填写表单的用户发送确认电子邮件.用户提交表单后,确认后,他/她将看到一个链接来编辑他/她的回复.

I have a simple Google Form that collects data, and, using AppScript, sends confirmation emails to users who fill it out. After user submits the form, on confirmation, s/he will see a link to edit his/her response.

我想将该链接作为确认电子邮件的一部分(目前,它只显示在页面上.)如何获取 URL 以编辑提交的回复?

I'd like to include that link as a part of the confirmation email (Right now, it only shows up on the page.) How can I obtain the URL to edit a submitted response?

我可以通过 SpreadsheetApp.getActiveSpreadsheet().getFormUrl() 获得表单的链接.它给了我以下格式:https://docs.google.com/a/domain.com/spreadsheet/viewform?formkey=<formKey>

I am able to get the link to the Form through SpreadsheetApp.getActiveSpreadsheet().getFormUrl(). It gives me the following format: https://docs.google.com/a/domain.com/spreadsheet/viewform?formkey=<formKey>

然而,该链接不包含编辑键,这是用户编辑他/她的回复所必需的.预期的 URL 应如下所示:https://docs.google.com/a/domain.com/spreadsheet/viewform?formkey=<formKey>&edit=<editKey>

The link however doesn't include the edit key, which is required for users to edit his/her response. The expected URL should look like this: https://docs.google.com/a/domain.com/spreadsheet/viewform?formkey=<formKey>&edit=<editKey>

提前感谢您的帮助!

-K

为此添加了功能请求:http://code.google.com/p/google-apps-script-issues/issues/detail?id=1345&thanks=1345&ts=1337773007

推荐答案

直到最近,@Henrique Abreu 才回答说这是不可能的.谷歌似乎添加了 getEditResponseUrl()FormResponse 类,这样就可以使用这样的代码获取一堆现有表单的编辑 URL:

The answer that this wasn't possible by @Henrique Abreu was true until very recently. Google seems to have added getEditResponseUrl() to the FormResponse class and with that it becomes possible to use code like this to get the edit URL for a bunch of existing forms:

function responseURL() {
 // Open a form by ID and log the responses to each question.
 var form = FormApp.openById('1gJw1MbMKmOYE40Og1ek0cRgtdofguIrAB8KhmB0BYXY'); //this is the ID in the url of your live form
 var formResponses = form.getResponses();
 for (var i = 0; i < formResponses.length; i++) {
   var formResponse = formResponses[i];
   Logger.log(formResponse.getEditResponseUrl());
 }
}

要使其在用户响应时自动向用户发送电子邮件,可以在表单提交时添加触发器.由于我正在处理的情况不需要人们使用应用程序帐户登录,因此我无法自动访问电子邮件地址,因此我有一个文本问题来捕获用户的电子邮件地址.

To make it automatically email the user as they respond one could add a trigger on form submit. As The situation I'm working with doesn't require people to log in with an apps account I don't have access to an email address automatically so I have a text question that captures the user's email address.

它确实询问了编辑表单是否是您想要的问题.我一直在努力解决使用 toPrefilledUrl() 这样我就可以看到随着时间的推移事情发生了怎样的变化.我想这归结为跟踪这将为您提供的价值.

It does ask the question about whether or not editing the forms is what you want. I've been grappling with the relative advantages of editing an existing response or sending a prefilled form using toPrefilledUrl() so that I can see how things have changed over time. I guess this comes down to the value that tracking this will provide you.

这篇关于如何添加“编辑回复"链接到 Google 表单电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆