0

I need to get the selected item in a drop-down list of the google form, but I don't know how to make this.

Someone could help me?

Thanks in advance.

Rubén
  • 34,714
  • 9
  • 70
  • 166

1 Answers1

0
  • A dropdown item is a ListItem
  • However, to retrieve the selected response, you do not need to know which type the item is, only which position it has in your form.

Sample retrieving the response for the first item of the first form submission (for the form yo which the script is bound):

function myFunction() {
  var form = FormApp.getActiveForm();
  var firstResponse = form.getResponses()[0];
  var dropdownResponse = firstResponse.getItemResponses()[0].getResponse();
  Logger.log(dropdownResponse);
}
ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • Hello, thank you for your response. I am working on a form that contains two drop-down lists. When I select an option in the first list I want a filter to be applied in the second drop-down list. How is this possible? – Miguel Hernandez May 12 '20 at 19:32
  • Unfortunately this is not possible, see [here](https://stackoverflow.com/questions/58418531/dynamic-dependent-dropdowns-on-google-form). As a workaround, you can create your own custom html form where you can implement it. – ziganotschka May 13 '20 at 07:19
  • 1
    Thank you for your help and time. – Miguel Hernandez May 13 '20 at 19:34