当前位置:首页 > 未分类 > 正文内容

Get the Form Edit Response URL in Google Sheets

ceacer3周前 (05-02)未分类1119

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()

const getFormResponseURL = (when) => {
  const formUrl = SpreadsheetApp.getActive().getFormUrl();

  const form = FormApp.openByUrl(formUrl);

  const responseDate = new Date(when);

  // Gets an array of all of the form's responses after a given date and time.

  const responses = form.getResponses(responseDate);

  if (responses.length > 0) {
    return responses[0].getEditResponseUrl();
  }

  return '';
};

Also see: Get Google Forms Data in Email

相关文章

How to Sort Google Sheets Automatically with Apps Script

How to Sort Google Sheets Automatically with Apps Script

This Google Spreadsheet on Udemy courses has about 50 sheets, one for each programming language, and...

Find Free Udemy Courses with Google Sheets and the Udemy API

Find Free Udemy Courses with Google Sheets and the Udemy API

Whether you are looking to learn a programming language, enhance your Microsoft Excel skills, or acq...

How to Make Phone Numbers Callable in Google Sheets and Docs

How to Make Phone Numbers Callable in Google Sheets and Docs

This tutorial explains how to make phone numbers clickable within Google Sheets, Slides and Google D...

How to Make Personalized Place Cards with Guest Names

How to Make Personalized Place Cards with Guest Names

Whether it is a wedding party or a business conference, those tent-shaped place cards are ideal for...

Color Codes for Google Spreadsheets

This Google Script converts the currently active Google Spreadsheet into a square grid of randomly c...

How to Play an MP3 File in Google Sheets

How to Play an MP3 File in Google Sheets

You can put the link of any MP3 audio file in Google Sheets but when you click the file link, the au...