Hi All, I have a multi-select dropdown inside a popup.
After selecting values and saving, the selected items are displayed outside the popup. When I click Add New again and reopen the popup,
I need the previously selected values to remain selected in the multi-select dropdown, as shown in the attached example (OML). How can I achieve this behavior?
URL : DropdownSerarch
Hi @maged shokry ,
Just pass the input parameter SelectedOptionList2 as the initial/starting selection.
Also, the issue mentioned in the URL you shared has already been resolved.
Hi,
You just need to use the list you already get from the Aggregate and pass it to the Dropdown Search StartingSelection when opening the popup.
If the Aggregate returns your previously saved values, map that result to the structure expected by the Dropdown and use that mapped list in StartingSelection.
So the flow is:
Aggregate result → Map to Dropdown Options → StartingSelection → Open Popup
This way, every time the popup opens, the Dropdown will already show the previously saved items as selected.
Just make sure the Value used in StartingSelection is the same Value used in the Dropdown OptionsList.
Hello @maged shokry
As mentioned above, you just need to pass your selected values in the starting selection
I am attaching your OML; by adding this, you can check
https://personal-l9q0mrdp.outsystemscloud.com/Dropdown/DropdownSerarch
You can also use this DropdownSetValue client Action by adding the dropdown ID to set values in the dropdown (it works on both dropdown tag and search)
Create a Data Action that returns the pre-selected values, with an output variable of type DropdownOption List. Populate the list as follows:
Then, wrap the Dropdown widget in an If condition and check whether the Data Action has already executed (YourDataAction.IsDataFetched). This ensures that the Dropdown is only rendered after the query has completed. You can then pass the Data Action output to the widget’s StartSelection.
One important caveat: avoid using the same variable for both StartSelection and the newly selected values. Doing so can cause the Dropdown to close unexpectedly when you open it and select an option.
Instead, I recommend handling the initialization through the widget’s InInitialize event. Inside the event handler, use the DropdownSetValue action, set the Id to the Dropdown’s Id, and pass the values returned by your query to SelectedValues.
This way, you initialize the Dropdown cleanly without interfering with its subsequent selection behavior :P