Hi,
I have two dropdowns in my interface. Based on first selected dropdown second dropdown has to chaange.
like, First dropdown is 'Country' . If i select the country it should display list of states for that country.
I have created multiple constants for states for each and every country.
My constants are
APPNAME_COUNTRY - List of countries
APPNAME_COUNTRYNAME1 - list of states for that country
APPNAME_COUNTRYNAME2 - List of states for countryname2
So if i select country i have to populate another dropdown (states) in Interface. So how can i call the constants dynamically. Below is the validation i tried but no luck. Please help.
if (isnull(ri!APPNAME_Customer_Details.address.country),null,cons!BP_+upper(ri!APPNAME_Customer_Details.address.country))
Regards,
Sirisha
Discussion posts and replies are publicly visible
Update the States drop-down choiceLabels / choiceValues array in Country drop-down saveInto. Set showWhen for States dropdown to display if a values is selected in Country
Please refer for example : community.appian.com/.../cascade-dropdown
Hi Priya,
I tried but i can use this only when i have two lists in first dropdown. But i have more than 2. In this way it is not allowing more than one IF condition.
In this case, you have to maintain States constant for each country. Based on selected country, you have to map the corresponding States constant to the variable of choiceLabels/ChoiceValues in Country dropdown SaveInto
I suggest you to go for a table option if you are having many Countries
Yes agree,Its possible with 2 but because you have a trimmed down second dropDown it will be though to do.If its only 2 you can have
1 constant with countires1 with statesSTATE_CONSTANT[value of country constant]
Please check the example
load( local!countryLabelConstant:{"IND","USA","UK"}, local!countryValuesConstant:{1,2,3}, local!indStatesConstant:{"TN","AP"}, local!usaStatesConstant:{"AL","AK"}, local!ukStatesConstant:{"JK","JL"}, local!states, local!selectedCountry, local!selectedState, { a!dropdownField( label: "Country", placeholderLabel: "Please select", choiceLabels: local!countryLabelConstant, choiceValues: local!countryValuesConstant, value: local!selectedCountry, saveInto: { local!selectedCountry, a!save( local!selectedState, NULL ), a!save( local!states, choose( save!value, local!indStatesConstant, local!usaStatesConstant, local!ukStatesConstant ) ) } ), a!dropdownField( showWhen: not( rule!APN_isBlank( local!selectedCountry ) ), label: "States", placeholderLabel: "Please select", choiceLabels: local!states, choiceValues: local!states, value: local!selectedState, saveInto: local!selectedState ) } )