Hi Team,
I have requirement in popup we have 3 dropdown options all 3 dropdown option use same Role list to display options. But my requirement to filter out the selected option from the dropdown option i.e what ever i select the option from the first dropdown that option should not display in second dropdown option & same applies for second dropdown option whatever i select in second dropdown option that should not display in third dropdown.
Hi @Anush Kumar, here is what you can do.
1. Create 2 more list variables of type same as you have in your 1st dropdown.
2. On the OnChange of your 1st dropdown, use list filter on the original list to filter out the selected value and assign the filtered list to the 2nd list created in first step.
3, Similarly, on the OnChange of your 2nd dropdown, use list filter on 2nd list to filter out the selected value and assign the filtered list to the 3rd list created in first step.
Also additionally keep the 2nd and 3rd dropdown disabled until user has selected value in 1st and 2nd dropdown respectively.
ThanksGitansh Anand
@Gitansh Anand Thanks for your input
Hi @Anush Kumar ,
You will need two local lists for the second and third dropdowns. To populate these lists, use the OnAfterFetch event of your aggregate.
In the OnChange event of the first dropdown, remove the selected value from the second list. You can achieve this using either ListIndexOf + ListRemove or ListFilter. In your case, ListFilter is recommended since it removes only one value. After filtering, assign the updated list to the one used in the second dropdown.
Similarly, in the OnChange event of the second dropdown, remove the selected value from the third list using ListFilter and update the third dropdown accordingly.
I attached an example OML.
Please check solution here. You can simply use listfilter to remove selected values from dropdowns
https://personal-u1aragiz.outsystemscloud.com/MultiDropdownSample/Demo?_ts=638768622166936570
Hi @Anush Kumar
1.Dropdown 1Source List: RoleListSelected Variable: SelectedRole1OnChange Event: Refresh Dropdown 2 & 3
2.Dropdown 2Source List: ListFilter(RoleList, Role -> Role.Id <> SelectedRole1)Selected Variable: SelectedRole2OnChange Event: Refresh Dropdown 3
3.Dropdown 3Source List: ListFilter(RoleList, Role -> Role.Id <> SelectedRole1 AND Role.Id <> SelectedRole2)Selected Variable: SelectedRole3Thanks,sahana
All you have to do is on the "On change event" of the dropdown you have to filter out the list varaiable, remove the selected list. This has be to done when the DropDown Variable is empty.
If the you have change exisiting selected dropdown value. First you have to add it back to the DropDown List and then filter and remove the current selected dropdown variable.
Thank You.
I would like to offer a completely different solution, where no extra copies of the list are necessary.
See this article.
Dorine
good article