cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KML
Level: Powered On

Filtering doesn't work.

Hi,

 

I would like to filter the gallery objects (which are the SQL view) to be filtered based on ListBox selected items.

The ways I tried to do it:

 

Filter('[dbo].[xxx]',Prod = ListBox1.SelectedItems)

This line gives an error: "Invalid argument type"

 

 

When I do simple filtering based on string Filter('[dbo].[xxx]',Prod = "Food") 

It works correctly.

 

3 REPLIES 3
KML
Level: Powered On

Re: Filtering doesn't work.

Somehow it does work when I use "Selected" instead of "SelectedItems" like:

Filter('[dbo].[xxx]',Prod= ListBox1.Selected.Value)

 

However it returns data filtered to first selected item (the listbox is a multiselect)

Delid4ve
Level 10

Re: Filtering doesn't work.

Do This:

 

Filter('[dbo].[xxx]',Prod in Concat(ListBox1.SelectedItems,Prod & ","))

 

Your Listbox has to be set to a datasource for it to work so you could use something like:

 

Distinct('[dbo].[xxx]',Prod)

on your list item box

Highlighted
Community Support Team
Community Support Team

Re: Filtering doesn't work.

Could you please explain a bit about the ListBox configuration, specially for the items property, and the Value part?

10.PNG

 

Basically, you should be able to filter the Gallery based on the formula below:

Filter('[dbo].[xxx]',Prod in ListBox1.SelectedItems.FieldName)

The FieldName is the field configured under the Value part.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,271)