Change value shown upon selected of dropdown input element?

Hi guys. Some help needed to use the dropdown input element properly… I’ve binded the dropdown element options to a list of countries variable array:

I also have a variable that updates on change of the dropdown element (called result.countrycode):

I’ve binded the “initial value” of the dropdown to my variable value:

But when I select an option in the dropdown, it is not showing this result.country_code variable value but the full country name…

How do I get only the country code to show?

Hi, I think its doable with the multiselect but not the select.

What you can do is :

  1. Replace your select with the multiselect
  2. Setup the layout type to free, it will allow you to drop text element inside the selection and options zones so you can bind what you want as text (the full label in the list, the value in the selection)
  3. Enforce single selection with a simple workflow on change + close on select option

here a little video I made to help => Loom | Free Screen & Video Recording Software | Loom

Thanks @Alexis ! Just to check, its not possible to have a different length for the selected option and the dropdown, right? (see screenshot below)

I don’t think so.

What you can probably do is create your own select in WeWeb, you have an example here