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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,681)