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 a gallery ba...
Power Apps
Unanswered

Filtering a gallery based on a selection from a data table

(0) ShareShare
ReportReport
Posted on by 601

Hello,

 

I've created a collection at the start of my app, ran a simple calculation to determine a total balance per customer and I'm using a fly-out menu in one of my galleries to display this information in descending order. I'd like to be able to allow users to filter the gallery based on the customer name that they selected from within the data table but when I try I get an "Invalid argument type" error for the equal sign. My current formula is set to the OnSelect property of the data table as follows:

 

Filter(ManaguerUIGallery.AllItems, 'CUSTOMER NAME'='Customer Name')

 

As always, thanks for any and all help.

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @CarlHRVA,

     

    I guess you are using a SharePoint list as your datasource? Is it a dropdown with the customer name? I think that would be a good solution. You then need a collumn in your list with the different names. 

    Then you add a dropdown to the screen with this formula in the Items value "MyList.Customernames", then its easy to filter the gallery based on the dropdown. The formula on Items for the gallery is "Filter(MyList, CustomerName = DropDown1.Selected.Value). 

     

    I also think your problem may be in using wrong quotes. Try to use " instead of ' after the equal sign. 

  • CarlHRVA Profile Picture
    601 on at

    Thanks for the quick reply! As far as your solution goes, I have a different pop-out where they can filter the gallery based on different dropdowns. The aggregate data for the total amount owed per customer doesn't exist in the data source so I pull it into a collection on load, group by customer name and then find the sum of all their balances and display them in a data table in descending order for them. This helps them to determine which customers to contact first in their collection efforts. I would like for them to be able to click any customer in that data table and have it sort the gallery where the customer name in the data table matches the customer name in the gallery.  So I was able to get the error to go away by switching the formula to the following. 

     

    Filter(ManagerUIGallery.AllItems, "CUSTOMER_x0020_NAME"='CUSTOMER NAME')

     

    But unfortunately, nothing happens to the gallery OnSelect. I'm hoping I'm using the right fields here, but maybe that was always the problem?

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

    Hi @CarlHRVA ,

    Do you want to filter a gllery based on the selection of a data table?

    If so, please try this formula:  (set the gallery's Items)

    Filter(tablename, 'CUSTOMER_x0020_NAME'=DataTable1.Selected.'CUSTOMER NAME')

    Since ManagerUIGallery.AllItems can not represent a data source, you can not filter a gallery's Items based on the items in the gallery.

    It is a kind of circulation.

    And your collection is the aggregate data, so I suggest you filter the data source directly.

     

    What's more, you can not compare two column directly like your formula:"CUSTOMER_x0020_NAME"='CUSTOMER NAME'.

    You need to compare one column with a value. DataTable1.Selected.'CUSTOMER NAME' represents the customer name that you select in the datatable.

     

    Best regards,

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard