cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kmk
Helper V
Helper V

How to filter items from selected multiple ListBox values

Hi Mates,

we have requirement to apply filter with multiple values... example : from list box 1 select multiple item next list box 2 load and display values respective rows.

 

When selected(clicked) on Car Then filter and display in list box 2 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

2 ACCEPTED SOLUTIONS

Accepted Solutions
eka24
Super User
Super User

Use

Sort(Distinct(Filter(Test,Travel in ListBox1.SelectedItems),Route),Result,Ascending)

 

Also try

Sort(Filter(Test,Travel in ListBox1.SelectedItems),Route)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Try

Sort(Filter(testdata, MoleculeType in lstb_MoleculeType.SelectedItems),MoleculeSource)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

8 REPLIES 8
eka24
Super User
Super User

Use

Sort(Distinct(Filter(Test,Travel in ListBox1.SelectedItems),Route),Result,Ascending)

 

Also try

Sort(Filter(Test,Travel in ListBox1.SelectedItems),Route)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,

"Sort(Distinct(Filter(Test,Travel in ListBox1.SelectedItems),Route),Result,Ascending)"

Here it shows invalid arguments with sort and distinct.

 

"Sort(Filter(Test,Travel in ListBox1.SelectedItems),Route)"

here it is loading some thing, but not target column values, i really afraid here how its loading other field values with out specifying/referring that column. 

means its loading other column but not target column.

result.png

Assist me how can load correct target field values only.

Can you show the items or the two listBoxes

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 

two list box:

first one formula : Distinct(table, TestField)

Second : Sort(Filter(table, TestField in lstb_MoleculeType.SelectedItems),SeconField)

 

First list box is loading few values.

Second list box is loading but not the target filed values, its loading another field values..

update.png

The movment when i click on first list box, items are adding in second list box but not the target field values.

second list box formula is there in the image.

If the target column is MoleculeType, then put tblData.MoleculeType on the Items of the ListBox.

So it should be TableName.Column

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 

list box 1 is loading MoleculeType values,

List box 2 is loading MoleculeSource field values,

even i tried as per recent update like TableName.Field but still no luck

Sort(Filter(testdata, MoleculeType in lstb_MoleculeType.SelectedItems),testdata.MoleculeSource)

here it shows error sort has invalid arguments.

Highly appreciate if you try from you end if possible, to close this issue.  

Try

Sort(Filter(testdata, MoleculeType in lstb_MoleculeType.SelectedItems),MoleculeSource)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,

below formula it self working fine.

i just removed Order then its fine.

Sort(Distinct(Filter(Test,Travel in ListBox1.SelectedItems),Route),Result)

Really Thanks for your support and help(helping on sharing formula)

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,248)