
Hi Mates,
we have requirement to apply filter with multiple values... example : from listbox select multiple item next listbox load and display values respective rows.
When selected(clicked) on Car Then filter and display in listbox2 with LA,Calif,SW, if selected/clicked car and Bus then has to load LA,Calif,SW,TR,TS but its not loading..
let say click/selected on Bus,bike then MM,TR,TS
As of now i have two list boxes(list box 1, list box 2)
list box 1 Property : Item: Distinct(Test,Travel)
list box 2 property : Item: Sort(Distinct(Filter(Test,Travel=list box 1.Selected Text. Value),Route),Result,Ascending)
here issue is i can not get values when selected multiple values, but i can get only for one item at a time
means as per table above
Also share your idea using list box is right way or if we have any simple/better way to filter by selecting multiple items.
Help would be highly appreciated.
Hi @Anonymous :
Do you want to implement the following functions:
Firstly , let me explain why you can only get the result of the first option.
The key is that "list box 1.SelectedText" only quotes the value of first record.In addition, "list box 1.Selected" is the same, only quoting the first record.
Secondly,I suggest you try "Travel in ListBox1.SelectedItems.Result".
The key is to get all the records.
I've made a test for your reference:
My data source:
ClearCollect(
Test,
{
Travel: "Car",
Route: "LA"
},
{
Travel: "Car",
Route: "Calif"
},
{
Travel: "Car",
Route: "SW"
},
{
Travel: "Bus",
Route: "TR"
},
{
Travel: "Bus",
Route: "TS"
},
{
Travel: "Bus",
Route: "MM"
}
)
Add two list boxes(ListBox1,ListBox2)
ListBox1-Items:
Distinct(Test,Travel)
ListBox2-Items:
Sort(Distinct(Filter(Test,Travel in ListBox1.SelectedItems.Result),Route),Result,Ascending)
Best Regards,
Bof