Forum Documentation Showcase Pricing Learn more

Get index of selected dropdown value

I have a list of texts as a field in a type of thing that I’m using to populate a dropdown. I need to set a custom state of element x whenever the dropdown value is changed. The custom state needs to be the index# (or position in list) of the selected value in the dropdown. how do i get the index of a specific item in the list of text or from the dropdown?

Take a look at this Any way to know the numeric position of a specific entry within a list

You will likely need the JS to Bubble or Expression element of the Toolbox plugin for this.

How do i go about using expression element of the Toolbox plugin?

Here’s a quick example that may help - https://bubble.is/page?type=page&name=expression_demo&id=louisforum&tab=tabs-1

1 Like

Thanks! This works perfectly.

1 Like