4

I'm writing a script to autocomplete some fields in a Google Form based on a field that has started to be filled out. For argument's sake, let's say it's address. So when a user fills the form out like so:

form1

And if in a spreadsheet called defaults there is a row with this address:

sheet1

Not only that field is updated, but any other fields that match are, too (like name and email).

Does anyone have any suggestions for me? My research has turned up nothing too useful for this case.

Community
  • 1
  • 1
t56k
  • 6,769
  • 9
  • 52
  • 115

1 Answers1

3

It's not possible to create an autocomplete field in a live Google Form. You can create a stand alone Apps Script Web App using HTML, CSS, and JavaScript. You could even style it to make it look like a Google Form.

Alan Wells
  • 30,746
  • 15
  • 104
  • 152
  • That's good enough for me. I don't suppose there's an easy way to throw the Google Forms functionality I've already built into a Apps Script web app? – t56k Jan 27 '16 at 21:00
  • 1
    Any code that you have in something like an "On Form Submit" trigger can be used for the most part. You'd want to create a different function name, and call it with `google.script.run.myFunctionName()` client side API. Basically, any server side `.gs` code can be reused, the difference is, you need to collect the form values, and send them to the server from your form. As far as things like "Go to Page" based on an answer, "No" you can't port that over. It's more work, to design the form yourself, but you have many more possibilities. And things like the Edit URL, aren't built in. – Alan Wells Jan 27 '16 at 21:06