Search code examples
htmlformsrestgoogle-apigoogle-forms

Google Forms prefill link with emailaddress


Google Forms has this nifty functionality of:

  • having Google to send the user an email upon submit
  • prefilling (entry.NUMBER=etc)
  • GET request to /formResponse?submit=Submit to just send off another GForm response

Now, I'm looking to combine all of these in this setup:

  • I have website with a form
  • I'd like to send that information to the GForm
  • AND I'd like the Google Form to send the user the email

The thing is: I just can't seem to be finding a way to also send along the emailAddress & emailReciept=true in a way Google seems to accept that.

So the happy flow would be:

  • User only fills in my form on the website
  • Website triggers REST API call to GForm and formdata gets send over
  • GForm sends user email

I have done several GET & POST requests, also debugging a live recreated form in Chrome Dev but I just can't seem to make it working that my requests (which come back as 200 OK) are being accepted and recorded

Edit: restating question. So what I'm hoping to find here is someone helping me forward to a way to send data over in one call, preferably a GET call with /formResponse?submit=Submit with the emailAddress & emailReciept=true information included.


Solution

  • An external website contains an HTML form. The goal is to:

    • submit form responses from the HTML form to a given Google form
      AND
    • have the Google Form send responders a copy of their response.

    This is not possible.

    In order for Google Forms to send responders a copy of their response, one must adjust the Settings option Send responders a copy of their response.

    This option relies on capture of an email address in one of two ways:

    • Verified - the respondent is required to sign in to Google.
    • Responder input - respondents manually enter their email address.

    Neither of these methods of collection can apply in the proposed scenario since respondents never interact personally with the Google Form.

    Of course, it IS possible to design an HTML Form/Google Form question that requires an email address and to submit the answer to the question but this will not trigger the Google Form to send the respondent a copy of their Form submission.

    Workaround

    An HTML form can submit responses to a Google Form OR to a Google Sheet. Both Forms and Sheets have an installable onFormSubmit trigger. This can be used to generate an appropriate email to each respondent.