2

If I have a Google Form, how might I use Apps Script to:

1.) Get the user's responses to questions on one page of the form

  • INTERJECT SCRIPT LOGIC

2.) (pause) the form and have the script activate to:

  • process their results
  • depending on the result of that processing, move them to a different page

Basically, I want to have the script analyze the results of a particular page, and redirect them to a new page depending on the results to multiple answers. There is a redirect utility in the form itself, but it only works for the result of one question. I have two questions that I need to ask, and based on both of those answers, move them to a new page.

I know that I can create Items that have a PageNavigationType as seen here, however, this is for a single item only. There is also no setPageNavigationType for Items, so I'm wondering if this is even possible to do dynamically as a user is filling out the form?

Chris Cirefice
  • 5,475
  • 7
  • 45
  • 75

1 Answers1

4

Hate to be the one to give the bad news, but that's not possible.

Google Apps Script only helps with the Form creation process (and editing), it's not possible to do anything while the user is filling it, period.

Also, it can only do programatically what you can do manually on the Form interface, it's useful only to help you automate things that would be cumbersome to do manually. For example, adding a long list of options to a question, or helping you generate and email hundreds of similar Forms. Or just really creating quick quizzes or some other forms that you have to create every week, etc.

Just to be completely clear to other users that might read this. It's not possible to do anything with Apps Script for Google Forms that you can't already do manually. Apps Script does not add any new or hidden features to Google Forms.

Henrique G. Abreu
  • 17,406
  • 3
  • 56
  • 65
  • 1
    This is really unfortunate... the 'little things' I wanted to implement to help guide our faculty at the university to the right information - I described this to my boss as 'simple' and 'easily-doable'. After actually looking through the documentation and not finding what I was looking for I came here to ask the GAS community. It really is an unfortunate day - if Google Forms were scriptable like a GUI that would be magnificent. Are there any reasons for them not having this functionality? I.e., user authenticating the script that runs, sharing, etc? Or just never considered/implemented? – Chris Cirefice Oct 31 '13 at 05:42
  • You could implement the form entirely on Apps Script, (a web-app) where you'd have full flexibility for such things. It's just a bit more difficult to build. Unfortunately Google Forms doesn't support that. – Henrique G. Abreu Oct 31 '13 at 09:41
  • Yes I suppose that is possible, but the time it would take to write that form into a web app is just too long unfortunately... thank you for your help though. I spent an hour looking through the documentation last night so I'm glad that you could confirm my fears about Forms! – Chris Cirefice Oct 31 '13 at 13:37