web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering doesn't work.
Power Apps
Unanswered

Filtering doesn't work.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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 Profile Picture
    795 on at

    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

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard