Skip to main content
Community site session details

Community site session details

Session Id : R/HCWZiz7FJo5BtiBVYkIl
Power Apps - Building Power Apps
Unanswered

Filter gallery based on combo box selections and multi-select SharePoint list column data

Like (0) ShareShare
ReportReport
Posted on 16 Oct 2021 19:50:20 by Microsoft Employee

Good afternoon, all:

 

Firstly, thank you to everyone that contributes to this forum. I've found it extremely helpful over the years!

 

Here's an outline of the issue I'm stuck on:

 

Data source: SharePoint list

App type: Canvas app

Goal: Filter a gallery via a combo box over a multi-select SharePoint list column. I'd like for users to be able to select multiple options and only display results if one of those options is in the SharePoint list column (the column itself is a multi-select choice field).

Roadblock: I've ran into issues filtering the gallery because it appears I'm attempting to compare two table records, which PowerApps doesn't seem to like. 

Example: 

Let's say my SharePoint list column is a multi-select field:

Column name: Options

Choices: ["Test 1", "Test 2", "Test 3", "Test 4", "Test 5"]

 

In my Power App there is a combo box for each of these options. If a user were to select "Test 1" & "Test 3", for example, I want to filter my gallery to show every item that has either "Test 1" or "Test 3" as an Options choice selected.

 

Does anyone have guidance on how to accomplish this? Appreciate your time and happy to provide further information if that is helpful.

Categories:
  • Omar_203 Profile Picture
    43 on 19 Apr 2022 at 12:59:29
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @WarrenBelz, I am trying to do something similar for an asset management system.

     

    I am trying to filter a gallery (with a collection of SharePoint lists) based on a combo box dropdown which uses user names from another Sharepoint List. So if one person's name is selected, it should only shows items which have that user's name. Currently, I am using a collection to display all items in the gallery which works fine, but it's just showing all items. 

     

    Combobox Items query: Choices(Users.'Full name')

    Gallery query: Collect(AllAssets, hardwareList, softwareList, accountList)

     

    What would be the best way to achieve this ?

     

    Thank you.

     

    Omar

  • Riokku Profile Picture
    Microsoft Employee on 17 Oct 2021 at 05:03:48
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @WarrenBelz,

     

    Thank you for helping me work through this.

     

    I was afraid that would ultimately be the answer. My goal was to filter the gallery by up to five different combo boxes, some with a many-to-one relationship with the data (these were easier to figure out), and several others with a many-to-many relationship. I'll try to think through ForAll() a bit more to see if a I can leverage it to create numerous collections and eventually merge them into a master collection that I can then filter on top of. 

     

    Appreciate your time this weekend.

  • WarrenBelz Profile Picture
    148,953 Most Valuable Professional on 17 Oct 2021 at 04:46:25
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @Riokku ,

    The ForAll() is not the gallery Items Filter - it produces the collection that now needs to form your gallery Items - you cannot dynamically resolve a many-to-many relationship with a Filter function.

     

    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.

  • Riokku Profile Picture
    Microsoft Employee on 17 Oct 2021 at 04:09:47
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @WarrenBelz,

     

    Thank you for the additional guidance.

     

    My ultimate hope is to be able to filter a gallery based on a multi-select field in the SharePoint list. The user could select one or more options via a combo box and have the gallery return results if they match one or more of the options chosen in the combo box, which is why ForAll may be able to help. You're correct that the many-to-many query has proved to be the issue.

     

    Do you have any insight on how to accomplish this type of filter logic? 

     

    Thank you.

  • WarrenBelz Profile Picture
    148,953 Most Valuable Professional on 16 Oct 2021 at 20:54:34
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @Riokku ,

    To answer your questions

    • Call colChoices whatever you want
    • Value is the valid output of the combo box - I assumed it was either hard-coded or a Choices field
    • Matching field name is the one that matches TestX
    • You do not need the last one - I see now it is a gallery you require (I mis-read)

    Why do you want a ForAll in a gallery filter?

     

    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.

  • Riokku Profile Picture
    Microsoft Employee on 16 Oct 2021 at 20:15:23
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi, Warren! Appreciate the quick reply.

     

    Hoping to share my attempted application of your solution to ensure I have the right fields/names in the right spots. Would you please let me know if the below appears correct?

     

    ForAll(
     ComboBox.SelectedItems, 
     Collect(
     colChoices, //"colChoices" is arbitrary
     Filter(
     YourDataSource, 
     Value in YourMatchingField //"Value" is arbitrary, "YourMatchingField" is my Sharepoint column name
     ).YourRequiredDisplayField //What does "YourRequiredDisplayField" refer to here?
     )
    )

     

    Lastly, would the hope be to embed this entire ForAll function side my gallery Items Filter function, such as the below?

     

    Filter(
     MyDataSource,
     ForAll(
     (above content)
     )
    )

     

    Thanks so much.

  • WarrenBelz Profile Picture
    148,953 Most Valuable Professional on 16 Oct 2021 at 19:59:48
    Re: Filter gallery based on combo box selections and multi-select SharePoint list column data

    Hi @Riokku ,

    You have a many-to-many query required - try a collection

    ForAll(
     ComboBox.SelectedItems,
     Collect(
     colChoices,
     Filter(
     YourDataSource,
     Value in YourMatchingField
     ).YourRequiredDisplayField
     )
    )
     

     

    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.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete