I have two or more dropdown component and I hope that these dropdown components can share one choice list.
For example
I have a list like {choice 1, choice 2, choice 3, choice 4,...}
In dropdown 1 the choice list should be {choice 1, choice 2, choice 3, choice 4,...}, when I choose choice 1 in this dropdown, the choice list of other dropdown should be {choice 2, choice 3, choice 4,...}, when I choose choice 2 in dropdown 2, the choice list of other dropdown (expect dropdown 1 and dropdown 2) should be {choice 3, choice 4,...}
Can appian do like this?
Discussion posts and replies are publicly visible
Hello edwardc8281 ,
Yes, can be done in Appian. Could you please elaborate where you would be saving the selected values? Is this going to be a huge set of dropdowns or just a couple of dropdowns with this behavior.
a huge set of dropdowns, meayb 10 or more
a!localVariables( local!labels1: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, local!value1, local!labels2: remove( local!labels1, wherecontains(local!value1, local!labels1) ), local!value2, local!labels3: remove( local!labels2, wherecontains(local!value2, local!labels2) ), local!value3, { a!dropdownField( choiceLabels: local!labels1, choiceValues: local!labels1, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: local!value1, saveInto: { local!value1 }, searchDisplay: "AUTO", validations: {} ), a!dropdownField( choiceLabels: local!labels2, choiceValues: local!labels2, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: local!value2, saveInto: { local!value2 }, disabled: a!isNullOrEmpty(local!value1), searchDisplay: "AUTO", validations: {} ), a!dropdownField( choiceLabels: local!labels3, choiceValues: local!labels3, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: local!value3, saveInto: { local!value3 }, disabled: a!isNullOrEmpty(local!value2), searchDisplay: "AUTO", validations: {} ) } )
You might want to redo the code a little bit. This is an example of how you can handle.
Thanks Konduru, I have tried this way, but if I have a huge dropdowns, like I have 10 dropdown component, I should creat 10 labels and values, right? What I want is use a more common or easy way to imply my require.
Instead of creating 10 different dropdowns, you can dynamically create dropdowns and update the values like the below sample code.
a!localVariables( local!labels: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, local!numberOfDropdown: enumerate(10), /* Created the map to store the values */ local!selectedValue: a!forEach( items: local!numberOfDropdown, expression: a!map(value: null) ), a!forEach( items: local!numberOfDropdown, expression: a!localVariables( local!currentLabelAndValues: remove( local!labels, wherecontains( /* retaining the selected option of each dropdown */ remove(local!selectedValue.value, fv!index), local!labels ) ), a!dropdownField( choiceLabels: local!currentLabelAndValues, choiceValues: local!currentLabelAndValues, label: "Dropdown - " & fv!index, labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: index(local!selectedValue.value, fv!index, ""), saveInto: local!selectedValue.value[fv!index], searchDisplay: "AUTO", validations: {} ) ) ) )
Note: You might need to change the code based on your business requirements.
That what I want, thanks