I'm trying to make the edit URL for a Google Form automatically populate in the response Google Sheet that it's attached to. I've seen this already and want to use it, but I'm having issues trying to figure out where exactly to put the script.
I've tried putting it in the script editor in the Google Spreadsheet that I would like the URL to appear in, but I'm not sure where to go from there. In the script editor I've tried to test it as an add-on but that didn't end up working.
I have little experience with scripts and the script editor in Google Sheets. As a final note I am using one other add-on called AutoCrat in the same Google Spreadsheet.
Best Answer
Short answer
The link points to a Q&A that has two answers but non-of them looks to me to be appropiate. I.E. the code of one of answers is incomplete and both of them send emails, so the adoption is too complex to be used as a starting point.
Below is a script that is easier to adopt.
Instructions
Create a test form and note the form ID (between![New form](https://i.stack.imgur.com/ThDwf.png)
../d/
and/edit
in the url).Set the form to send responses to a new spreadsheet.![Connect a spreadsheet](https://i.stack.imgur.com/w72gk.png)
You'll be redirected to the new spreadsheet. Note the active sheet name (rename it if you want) and add a header to the column to be used to hold the response edit URLs, i.e.![Responses spreadsheet](https://i.stack.imgur.com/sZMns.png)
Edit Url
. NOTE: Capitalization is very important, so be very careful on how do you write it.Go to![Spreadsheet scripts](https://i.stack.imgur.com/nlfsE.png)
Tools > Script editor
to add a Google Apps Script project bounded to the spreadsheet.Replace the default code with the code below (remember to edit the global variables according to your case).![Script code](https://i.stack.imgur.com/6IL3A.png)
Save the project, and then add an installable form summit trigger (if you get an "Authorization required" dialog, click "Review Permissions" and then "Allow").![Form submit trigger](https://i.stack.imgur.com/YL9Zf.png)
Submit some sample responses to test the solution.
Code
Additional resources
I created a gist with the content from the question and answer. this b/c I'm exploring ways to better collaborate between end-users who write code.