How to dynamically show HTML to Google Forms responder, based on their quiz answers?

267 views
Skip to first unread message

Rhys Compton

unread,
Aug 2, 2020, 8:13:50 PM8/2/20
to Google Apps Script Community

I'm creating a survey which evaluates the 'health' of a user based on their answers.


It's created as a quiz with 'golf-scoring', i.e. the lower the score the better their health, and it should display some graphical result at the end based on their final score (ideally a traffic light style diagram).


The question I'm stuck on is: how to show some HTML to the user? It seems like it should be a fairly straightforward task but I haven't been successful. I'm a developer so am comfortable using App Script, but then this article makes it sound like there's no way to show dynamic content to the user.


We'll be sending an email to them and it seems like this is pretty customizable so I'm able to implement a nice diagram for that, but I'd also like to show this in the form.


Has anyone been successful in using App Script to show some custom UI to the user?

Mani Doraisamy

unread,
Aug 2, 2020, 9:12:23 PM8/2/20
to google-apps-sc...@googlegroups.com
Hi Rhys,
You can not modify the end user UI of Google Forms using Apps Script. However, you can use Formfacade addon (Disclaimer: I wrote it) to do this:
Hope that helps.

thanks,
mani


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/361c1d14-bd04-43c0-b003-9f1834be920fo%40googlegroups.com.

Fernando Falcao

unread,
Aug 2, 2020, 9:14:02 PM8/2/20
to google-apps-sc...@googlegroups.com
Hi Rhys,

As far as I know it is not possible to have this kind of interaction with the respondents using Google Forms. You would need to use HTML service instead. You form should be created using HTML service.

But, let others say their experience!

Cheers,
Fernando

--

Clark Lind

unread,
Aug 3, 2020, 8:45:39 AM8/3/20
to Google Apps Script Community
As others have said, not possible within the Google Form API. You can send HTML email via Gmail because that accepts html input, but G-forms do not. So you are better off, as they said, starting with your own html form and interface how you wish. So it begs the question, why use Google at all? Is it for the quiz feature in forms? 

I've seen a couple youtube videos showing where their html form was linked to a google form using the same form element ids in their html form. That might be a way to pursue it. You might even embed the google form within your own html page as a wrapper, and then when the content changes, you could run your own code. --Pure conjecture, no idea if this is possible, just trying to think outside the google box :)

Rhys Compton

unread,
Aug 3, 2020, 5:19:27 PM8/3/20
to Google Apps Script Community
Thanks for the quick replies everyone.

@cwlind Given that I'd have to make my own HTML form and make my own interactions, I wouldn't bother with Google Forms. I do want to use Google Forms as it's a free service so I'll just forego the feature of showing the final screen based on score.
Something like this in TypeForm is exactly what I wanted to do.

Interesting idea, I'll have a look at whether that's a viable option :)

Rhys Compton

unread,
Aug 3, 2020, 5:20:26 PM8/3/20
to Google Apps Script Community
This might do the trick, thanks I'll look into it :)


On Monday, August 3, 2020 at 1:12:23 PM UTC+12, Mani Doraisamy wrote:
Hi Rhys,
You can not modify the end user UI of Google Forms using Apps Script. However, you can use Formfacade addon (Disclaimer: I wrote it) to do this:
Hope that helps.

thanks,
mani


On Mon, Aug 3, 2020 at 2:13 AM Rhys Compton <rhys....@gmail.com> wrote:

I'm creating a survey which evaluates the 'health' of a user based on their answers.


It's created as a quiz with 'golf-scoring', i.e. the lower the score the better their health, and it should display some graphical result at the end based on their final score (ideally a traffic light style diagram).


The question I'm stuck on is: how to show some HTML to the user? It seems like it should be a fairly straightforward task but I haven't been successful. I'm a developer so am comfortable using App Script, but then this article makes it sound like there's no way to show dynamic content to the user.


We'll be sending an email to them and it seems like this is pretty customizable so I'm able to implement a nice diagram for that, but I'd also like to show this in the form.


Has anyone been successful in using App Script to show some custom UI to the user?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages