I have studied this question and found it helpful:
How do I edit the response of a form submission in Google Forms/Sheets?
Now I would like to take it a step further. Once I have the editable response URL, I notice that when I go to the URL and edit and submit the response, it modifies the original response line in the sheet.
What if, instead of modifying, I want to make a NEW response. That is, upon editing, when I Submit, the set of responses makes a NEW row in the spreadsheet. I'm trying to think of a way I can do this, but not coming up with anything. Any ideas?
Related
I submitted a response to a google form I was sent. I had the option to edit it afterwards however I didn't save the URL.
Is there anyway to find the URL or to edit my submission?
It is possible to get the edit response URL on submission.* (And have it written to a sheet, or emailed.)
In your case however, if you want to edit your previous response you can go to the form using the same url. (If it is limited to one response, you should have an option to edit your response.)
Using Google App Script
I have a google script that generates the edit URLs for each form response that is dumped into my spreadsheet. Is there a way to programatically change the response values as if I had actually opened the URL and changed the values manually?
For example, suppose someone submitted a form with the name field being "Sam." I want to be able to programmatically edit this response so that the value of the same field is "Samuel."
This is very easy to do manually via the form response edit url, however I am running into issues trying to do this in my scripts.
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 be 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.
I am using a form to collect booking details and have the script attached to the form (so that the form submit trigger will trigger when the response is edited, which the spreadsheet bound version does not allow) which sends an email, schedules calendar events, creates confirmation documents etc on form submit. Using if statements I have provided the user the ability to avoid 'click the box to not send the customer an email on submit' functionality so that the form responses can be edited without triggers the automated functions, but that relies on the user remembering to click those boxes.
A better solution would be to be able to have the script, as its final function, change the item response, so that when the form is edited in future, the automatic functions are already disabled.
I do not want to create a new form response (although it would be possible to tweak the pre-populated url to create a duplicate with the appropriate changes)
FormResponse.withItemResponse(response) specifies that it doesn't work on stored responses
It is so easy to view form responses, and with the native edit response url functionality I figured editing a single item response would be doable, but so far it has eluded me.
Is there a way to do this?
Thanks
At this time Form responses could only be created programmatically, they can't be edited programmatically. Consider to submit a feature request through Google Apps Script Issues
I am trying to develop a form. I have created it and am getting responses in a worksheet. However, after amendment I am getting blank columns where changes were made.
I tried deleting the Response sheet but it appears not to make a difference.
Secondly is there a way of running a script when the Form Submit button is clicked?
1:
Reconnect the form to the response sheet or create a new response sheet.
You are not supposed to mess with the response sheet data or format.
2:
see trigger onFormSubmit