Faisal Wahab
Faisal Wahab

Reputation: 11

Dynamically Update Google Form 'Choose from list' options from RESTFUL Api

Actually, I am trying to make a Google form in which I have 3 dropdown fields and their options which i need to dynamically populate/update.

  1. 1st Dropdown (Select Country)
  2. 2nd Dropdown (Select State / Province)
  3. 3rd Dropdown (Select City)

I have one restful (GET) API for getCountriesList, so what I need to do is when form load country dropdown will be filled after making getCountriesList API and then on the base of country selection, I have one more API to getCountryStates and that API will fill the state/provice dropdown. same as for city dropdown.

Actually, my main question is how to get triggers

  1. form loaded
  2. option selected from the country dropdown or state dropdown. so I can call the APIs.

Upvotes: 0

Views: 2450

Answers (1)

Wicket
Wicket

Reputation: 38340

At this time the Google Form doesn't have an API, but Google Apps Script (GAS) has a service to handle forms. Unfortunately GAS doesn't have triggers for that. To learn about what triggers are available on GAS see https://developers.google.com/apps-script/guides/triggers.

You could try to "hack" (in the good way) the resulting form. This is easier by switching to the old Google Forms than with the new, because the old forms use "basic" html form tags and some "basic" JavaScript while the new Google Forms are a more complex and harder to "hack".

Related:

Upvotes: 1

Related Questions