Search code examples
google-apps-scriptdrop-down-menugoogle-forms

How to retrieve selected answer from a drop-down question in Google Forms


I am creating a Google form where the first 3 questions are linked. With this in mind, I need therefore to be able to access the response for question 1 to use it as a parameter for question 2 and so on.

I am using a ListItem object where the object contains the names of continents in question 1, countries in that continent in question 2 and universities in that country in question 3. I've searched around and haven't found any way of accessing the answers as the user selects them.

I've thought about using sections to maybe get the information from one section to another but I haven't managed to do that either.

What I would like, in a perfect world, is the user to select an answer from question 1, depending on that answer, the choices for question 2 will change and same for question 2 with question 3.


Solution

  • Selected Value from DropDown in standard html form

    var selectElement = document.getElementById('selectId');
    var selectedValue = selectElement.options[selectElement.selectedIndex].value;
    

    Selected Value from DropDown in Google Form

    It can't be done because you can't interact with running Google Form