Edit your Response URL in Google Spreadsheets

E
Published in: Google Apps Script - Google Sheets

When a user submits a Google Form, the entry is saved as a new row in the Google Spreadsheet that is collecting the responses. The Timestamp column in the spreadsheet can help you get the Edit Response URL for any entry in the form:


// when = e.namedValues["Timestamp"].toString()

function getResponseURL(when) {

  // Get the Form ID from the linked Spreadsheet
  var form_id = SpreadsheetApp.getActive().getFormUrl().match(/[\_\-\w]{25,}/);

  var form = FormApp.openById(form_id[0]);

  var response = form.getResponses(new Date(when))[0];

  return response.getEditResponseUrl()

}

Also see: Get Google Forms Data in Email

Published in: Google Apps Script - Google Sheets

Looking for something? Find here!

Meet the Author

Web Geek, Tech Columnist
A
Amit Agarwal

Amit Agarwal is a Google Developer Expert in GSuite and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. Read more on Lifehacker and YourStory

Get in touch