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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter a Gallery with ...
Power Apps
Answered

Filter a Gallery with a Combo Box with Sharepoint MultiSelect Value

(0) ShareShare
ReportReport
Posted on by 28

Hi! I have already asked a few similar questions, but I am new so I have endless questions. I will also mention I am using power apps in teams.

I have a gallery and I would like to filter it with a multiselection combo box. So far I have the below filters/sort/search on my gallery.

 

SortByColumns(Search(Filter('business.plan','Add to App'=!"F"), TextInputCanvas1.Value,"Title"), "DueDate",SortOrder.Ascending)

 

My current combo box is hard coded as: ["Population 1","Population 2", "Population 3", "Population 4"] with the multi select turned on in properties.

 

My gallery is using a sharepoint list (called 'business plan') and the column I need to search with the combo box is called 'Population'. The population column in sharepoint is a multi value select value. 

 

In my gallery, I currently have that column displayed through a concat so all the values are listed that are selected, but I would like to filter the gallery by specific populations. Any ideas?  

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @Electrariley ,

    What is different here to this solved post other than the adding of the SortByColumns? Assuming Population is a multi-value field and your Combo Box is also multi-selection - the last solution I provided  based on the information you posted (adding the SortByColumns in now and a small alteration)

    With(
     {
     _Data:
     SortByColumns(
     Search(
     Filter(
     'business.plan',
     'Add to App'=!"F"
     ), 
     TextInputCanvas1.Value,
     "Title"
     ), 
     "DueDate",
     SortOrder.Ascending
     )
     },
     If(
     Len(dropdowncanvas2.Selected.Value) = 0,
     _Data,
     Ungroup(
     ForAll(
     dropdowncanvas2.SelectedItems As _Sel,
     Filter(
     _Data,
     _Sel.Value in Population.Value
     )
     ),
     "Value"
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Electrariley Profile Picture
    28 on at

    Hi @WarrenBelz. I thought maybe I messed something up when I added the sort because now when I select a value in my combo box the gallery doesn't filter, but your recommended code is not indicating an error either. Apologies, I have been sick so I'm probably also slow to grasp what is happening.

  • Electrariley Profile Picture
    28 on at

    @WarrenBelz I re-entered the above and actually I am getting errors for the components in the gallery. For example, the gallery has title, subtitle, and body format. In the Text property I have ThisItem.'Training Plan Name' & " | "& Concat(ThisItem.Population,Value,", "). Do I need to update this to work with the filter? This is the component of the gallery I am trying to filter for Population.

     

    The error says "The name isn't valid", but if I revert back to the original formula without the combo box everything works.

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @Electrariley ,

    Two things - I have made a small change to the combo box empty filter, and tested here to get results, but all the fields in your list should be available in the gallery to reference.

    The second issue is what is business.plan ? It is unusual to have . inside a data source name. YOu also mention a component - can you firstly try this in a gallery with everything simply on the screen.

  • Electrariley Profile Picture
    28 on at

    Apologies @WarrenBelz I had to work and couldn't respond back as quickly. I did exactly what you advised. I deleted the gallery and remade it and now your code above works perfectly. The business.plan is actually 'business plan'. I realized that in the gallery it did not like thisitem.course number and wanted thisitem.coursenumber instead for the text property. The extra space was causing all the errors in the text properties in the gallery. Thank you for recommending to go back to a simple screen. It made it very clear where my error was. Super appreciate your patience.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard