如何编辑Google表单/表格中表单提交的回复? [英] How do I edit the response of a form submission in Google Forms/Sheets?

查看:1057
本文介绍了如何编辑Google表单/表格中表单提交的回复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在进行调查。我开始在Excel Forms Online中创建它,但在意识到它的一些缺点后,切换到Google窗体。我碰到了一些麻烦,但我认为我已经准备好了。

不幸的是,我开始向表单添加问题并改变了答案(拼写错误等)这开始引起了一大堆问题。只要适用,我必须回去向用户询问他们对新问题的回应就足够了。更糟糕的是,我根本无法修改提交。我无法编辑连接到表单的电子表格,因为结果存储在表单中。如果我重新生成电子表格,则表单中提交的响应会替换之前的任何内容。所以我根本无法编辑电子表格。



我一直在寻找一种方法来尝试手动编辑用户提交的响应。我在Stack Overflow上找到了资源 ,并在产品论坛的Google Groups上 ,但不幸的是,我尝试了所有的例子,但他们都没有工作(是的,我把我的表单的URL放入其中,并用电子表格名称替换了名称)。



错误I填充我的信息后继续接收 TypeError:无法调用null的方法getDataRange。 (第8行,代码文件)。但这张表并不是空的,我知道这一点。



是否有其他方法可以使这项工作成为可能,或者更好地编辑表单响应?



现在唯一的方法是手动 返回并重新提交表单作为该用户 。这是一种痛苦,因为它是10分钟检查框和复制粘贴。另外,昨晚我不小心跳过复制1个字符,现在我不得不再做一遍。



从我在网上看到的,这可以完成,但没有任何我尝试过的作品。该表格目前正在运行并接受回复。任何解决方案都是可以接受的,只要通过脚本或其他工具编辑他们的响应,所以我不需要自己手动重新做所有事情。

此处建议的代码正常工作,因为我刚刚尝试过我自己在2017年2月13日。



以下是我遵循的步骤来完成这项工作




  • 首先,加载您的表单,就像您要编辑表单一样。 在地址栏的url中查找表单的表单ID。它应该看起来像这样:




https://docs.google.com/ ...
/ forms / d / 1ZIrWiRZQrUsz1y8OBoeB7AtCOM4Ax4FxAQm8xAR1OYo / edit





  • 所以这个例子中的id应该是1ZIrWiRZQrUsz1y8OBoeB7AtCOM4Ax4FxAQm8xAR1OYo

  • 现在请转至 https://script.google.com

  • Code.js 部分中显示的所有文本替换为以下内容,之后编辑它,并将表单标识替换为以下YOUR_FORM_ID_HERE。

     函数dumpEditResponseUrlsForYourForm(){
    //更改下一行以使用表单的ID
    var myFormId =YOUR_FORM_ID_HERE;

    var form = FormApp.openById(myFormId);
    var formResponses = form.getResponses();
    for(var i = 0; i< formResponses.length; i ++){
    var formResponse = formResponses [i];
    Logger.log(formResponse.getEditResponseUrl());
    }
    }


  • 点击Google脚本网站中的查看|日志页。它会弹出一个窗口,其中包含指向表单回复的链接。


Recently, I've been conducting a survey. I began creating it in Excel Forms Online but switched to Google Forms after I realized several of its shortcomings. I hit a few snags but I thought I was all set to go.

Unfortunately, I began adding questions to the form and changing responses (misspellings, etc...) and this began causing a whole bunch of problems. It's enough that I have to go back and ask users for their responses to new questions if applicable. What's worse is I can't modify a submission at all. I can't edit the spreadsheet connected to the form because results are stored in the form. If I regenerate the spreadsheet, then the response submitted in the form replaces whatever was there before. So I can't edit the spreadsheet at all.

I've been looking into a way to try to manually edit a user's submitted response. I found a resource here on Stack Overflow, and here on Google Groups at the Products Forum, but unfortunately, I tried all of the examples and none of them worked (yes, I put my form's URL in and everything and replaced the name with the spreadsheet name).

The error I continued receiving after I filled in my info was TypeError: Cannot call method "getDataRange" of null. (line 8, file "Code"). But the sheet is not empty and I know that.

Is there some other way to make this work, or a better way to potentially edit sheet responses?

The only way to do this right now is to manually go back and re-submit the form again as that user. It's kind of a pain because it's 10 minutes of checking boxes and copying and pasting. Plus, last night I accidentally skipped copying 1 character and now I'd have to do it all over again.

From what I've seen online, this can be done, but nothing I have tried works. The form is currently live and accepting responses right now. Any solution is acceptable as long as there would by a way to edit their responses, either with a script or some other tool, so I don't need to manually re-do everything myself.

解决方案

The code suggested here works, as I just tried it myself on Feb 13, 2017.

Here are the steps I followed to get this to work

  • First, load your form as if you were going to edit the form.
  • Look for the "form id" for your form in the url in the address bar. It should look something like this:

https://docs.google.com/... /forms/d/1ZIrWiRZQrUsz1y8OBoeB7AtCOM4Ax4FxAQm8xAR1OYo/edit

  • So the id in this example would've been "1ZIrWiRZQrUsz1y8OBoeB7AtCOM4Ax4FxAQm8xAR1OYo"
  • Now go to https://script.google.com
  • Replace all the text that shows up in the Code.js section with the following, AFTER you've edited it and put your form id in place of YOUR_FORM_ID_HERE below.

    function dumpEditResponseUrlsForYourForm() {
       // Change this next line to use the id of your form
       var myFormId = "YOUR_FORM_ID_HERE";
    
       var form = FormApp.openById(myFormId); 
       var formResponses = form.getResponses();
       for (var i = 0; i < formResponses.length; i++) {
         var formResponse = formResponses[i];
         Logger.log(formResponse.getEditResponseUrl());
       }
    }
    

  • Click "View | Logs" in the Google Script web page. It'll pop up a window with links to your form responses.

这篇关于如何编辑Google表单/表格中表单提交的回复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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