0

I'm trying to create Google Form that redirects to a Web App when a user finishes a form submission.

I have checked the Google Developer documentation, but I can't see an easy way to do this. I have seen this functionality is does not exist natively in Google Form App Scripts, so ideally, I'd like them to press submit and for the app to serve them some html which redirects them to the web app immediately. For example, the code below:

HtmlService.createHtmlOutput( 
"<script>window.location.href = "google.com";</script>");
Connor
  • 867
  • 7
  • 18
  • 1
    Create an onFormSubmit trigger and handler function – Cooper Aug 02 '22 at 20:09
  • 1
    You can use Logger.log(JSON.stringify(event object)); to see all of the event object features wihich include values and namedValues as described [here](https://developers.google.com/apps-script/guides/triggers/events#form-submit). It's pretty simple actually – Cooper Aug 02 '22 at 20:11
  • @Cooper I tried doing that through the trigger manager in AppScripts but it did nothing when I gave it the url redirect, so I assumed it wasn't possible via this method. – Connor Aug 02 '22 at 20:23
  • You must place it in the handler function. – Cooper Aug 02 '22 at 20:45
  • function onFormSubmit(e) { Logger.log(JSON.stringify(e));} – Cooper Aug 02 '22 at 20:47

1 Answers1

1

From the question

I'm trying to create Google Form that redirects to a Web App when a user finishes a form submission.

This isn't possible by using Google Apps Script. The form submit trigger isn't able to interact with the client-side / user interface of the form view. If you really need this kind of customization with Google Apps Script, you could make your form by creating a web application.

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166