0

We have a Google bug reporting form we are deprecating. I want to redirect our users to the new form when they land on the old form site.

I've created GAS script on the old form and tried several things I found in this SO question to redirect to the new form:

function myFunction() {
  //window.location = [new bug form URL];  //doesn't work
  //window.location.replace([new bug form URL]); //doesn't work
  return HtmlService.createHtmlOutput([new bug form URL]); //doesn't work
}

I've also set a trigger to run myFunction, "From form", "On Open" and I can see in:

View > Execution Transcript

that the script is being run, but nothing happens.

[13-10-24 13:42:11:324 PDT] Starting execution
[13-10-24 13:42:11:327 PDT] HtmlService.createHtmlOutput([new bug form URL]) [0 seconds]
[13-10-24 13:42:11:328 PDT] HtmlOutput.toString() [0 seconds]
[13-10-24 13:42:11:328 PDT] HtmlOutput.getContent() [0 seconds]
[13-10-24 13:42:11:328 PDT] HtmlOutput.getTitle() [0 seconds]
[13-10-24 13:42:11:329 PDT] Execution succeeded [0.0 seconds total runtime]

Got any idea what I'm doing wrong? I can find lots of examples for doing things in a Google Form upon submittal, but not on landing.

I know that I can simply stop accepting responses on the old form, but the problem is that we have a number of people on the production floor who don't check email regularly and they know where the old form is. I just want to automate taking them to the new form if possible.

Community
  • 1
  • 1
delliottg
  • 3,950
  • 3
  • 38
  • 52

1 Answers1

0

This is not the answer I was looking for, but if you set the old form to "Not accepting responses", a new text box shows up beneath the form settings box with the heading: "This form has been turned off." Inside there is some canned text that you can simply edit, and provide a link to the new form, which shows up as clickable to the user. It's not an auto-redirect, but it's functional.

I'd still like to be able to do the redirect programmatically, so if anyone has done this, please post here (you'll get the answer checkmark).

delliottg
  • 3,950
  • 3
  • 38
  • 52