Get correct value of select in "On Change Event" of select component

I have 2 dropdown (select) components - 1 contains list of country names, another 1 for city names.
When I select a country from “Country” select component, I want the options in “City” select component to show cities in the selected country only.

In the “On Change Event” logic of “Country” select component, the “Get Value of Select” returns the last selected value before the change event, instead of the new selected value after the change event.
image

For example, when I change “Country” select component from “USA” to “Germany”, “Get Value of Select” in the “On Change Event” (logic of the “Country” select component) returns “USA” instead of “Germany”.
Therefore, I update the city names in “City” select component wrongly.
Can anyone advise how do I accomplish this ?
Thanks.
Deric

1 Like

Hello @Deric_Voon

That’s right, the On Change Event is called before the new value is set and you are able to validate and change or not change the select’s value.

In order to get the next selected value, you have to use the Changed Value block

Regards, Vlad

Thank you very much Vlad.