I need to make a dropdown from a local variable, and from that data I need to make a filter based on a chosen value. For example, from a record from the dropdown, the price will appear based on the chosen record, and all happens locally.
I know how to do it globally with filtering and refreshing from aggregate, but I need to do it locally. Perhaps someone knows how to?
Hi shaped clouds,
Could you provide a bit more context on what you're trying to achieve? When you mention "creating a dropdown from a local variable," do you mean that the list you're trying to filter is a local list rather than an aggregate?
If that's the case, you can use the ListFilter action to filter your local list based on the selected item from the dropdown. Just use a condition like LocalList.ProductId = SelectedProductId to match the relevant records.
Hi @shaped clouds , hope you’re doing well.
In order to achieve this all locally, first of all you need to prepare the your local data.
Create a local variable as LocalList of type List of Product, with attributes for eg; id name and price respectively.
Create one more local variable to store the chosen value, eg; SelectedProductId (type : identifier)
For the dropdown widget
Source should be - LocalList, Text- Name, Value-Id and Variable - SelectedProductId.
Create an expression using the ListFilter function to display the selected value.
You can also use a Listfilter Action on the OnChange event to find the Selected Product details (price)
Hope this helps.
thanks and regards!
hi,
You can refer to the forum discussion. Hope it helps.
https://www.outsystems.com/forums/discussion/83163/use-dropdownsearch-to-filter-a-list/
Thank u.
Hi @shaped clouds
I created a OML refer it
Hi @shaped clouds,
You can do this by applying a list filter when the dropdown value changes.
I am attaching a OML let me know if you face while implementing.
Hope this heps
Thanks
@shaped clouds ,
I would suggest use Dropdown search and Show Item and Price together no need to search by locally.
Also you can set (expression) in same drop down -while use custom type, and shoe both item and price together.
Hope this will help you.
Hi @shaped clouds ,
Refer this OML,I hope it will helpful to you.
Thanks,
@Sudha Narayanan