cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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)

Super User
Super User

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

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 50 members 4,258 guests
Please welcome our newest community members: