73828

Retrieving the link to a response from a Google Form

<h3>Question</h3>

I have a script attached to a Google Form which sends a notification to a Discord channel on submission. I want to include a direct link to the individual response (link looks like https://docs.google.com/forms/d/<myformid>/edit#response=<responseid>). How can I retrieve that link? I get part of the link up to /edit with Form.getEditUrl() but I can't get the correct id. I checked FormResponse.getId() but that doesn't link me to any response.

Here's how to get to that link manually via edit form:


<h3>Answer1:</h3>

Since you know the response Id, you can use the geEditResponseUrl method to get the direct link to the form response. Do note that anyone with this URL can edit the response.

function getEditUrl(responseId) { var form = FormApp.getActiveForm(); var response = form.getResponse(responseId); return response.getEditResponseUrl() }

来源:https://stackoverflow.com/questions/48368843/retrieving-the-link-to-a-response-from-a-google-form

Recommend

  • Corrupted files uploaded on REST method call
  • Understanding HttpServletRequest and cookies in JSF
  • NGINX/JENKINS: It appears that your reverse proxy set up is broken
  • How to use mmap to point to STL type?
  • Firebase Cloud Messaging: how to send data message to all users? [duplicate]
  • COM Interop hang freezes entire COM system. How to cancel COM call
  • How can I find the difference between two times [duplicate]
  • CABasicAnimation creates empty default value copy of CALayer
  • how to add Image in JPanel
  • Spongycastle is missing many algorithms when loaded on android
  • Custom Timeline items in Glimpse
  • Unable to run testNG tests from maven
  • UIScrollView does not restore properly
  • Why do you need 2 Javascript files for cross-platform Cordova plugin?
  • How to use Typescript with libraries like Ampersand.js that parse configs to build prototypes
  • Copy and paste data from multiple workbooks to a worksheet in another Workbook
  • Java .policy file - how to prevent java.util.Date() from being accessible
  • trigger ontouch event programmatically
  • java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringDispatcher-ser
  • How to merge objects within array based on attribute
  • Django, uWSGI & nginx: Process dies for “no reason”
  • using maven pom while creating jar:test-jar some times it says JAR will be empty - no content was ma
  • How to configure the APNS.Certificate in the arm template
  • Geokit in Ruby on Rails, problem with acts_as_mappable
  • Unable to create Access token grant type in wso2 API manager store to test API
  • JavaScript Regex to Match Boundaries of Words with diacritics
  • how to get the location(lat/lng) on google maps v3 from the location(x,y)
  • How to turn off notice reporting in xampp?
  • jQuery scrollTop if URL has hash
  • How to change user identity when git pushing via ssh?
  • php “page caching” solution suggestions for CMS Applications
  • Update cell query for Excel ADO from Delphi
  • How to get rgb from transparent pixel in js
  • How to call different template for different category archive page in woocommerce
  • How to use FirstOrDefault inside Include
  • PHP Permalinks.. how to change?
  • Running R's aov() mixed effects model from Python using rpy2
  • Creating random wired topology for given arbitrary number of nodes on NS2
  • ReferenceError: TextEncoder is not defined