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 / Many on Many Filter fo...
Power Apps
Unanswered

Many on Many Filter for Multi-Choice People SharePoint Field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

So I have a Gallery with Items. One of the Columns called Owners is a Multi-Choice People field.

 

I created a dropdown above the Gallery that has a list of Owners.
When I select the Owner(s) in the dropdown, I need to filter the list in the gallery to only display the results for that Owner(s).

I see an example here posted which I slightly modified to work with a People field.

https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Many-on-Many-Filter/ba-p/789211

However, I'm not able to filter the Gallery using the method in the above post./

What would be the equivalent of that method for a multi-choice People field?

 

For the dropdown combobox:

Clear(colAllPersons1);
ForAll(SPList As Source,Collect(colAllPersons1, {PersonInfo: Source.Owners} ));
Clear(colAllPersons2);ForAll(colAllPersons1 As Source,Collect(colAllPersons2,Source.PersonInfo));
ClearCollect(colAllPersons3,Distinct(colAllPersons2,Email));
Clear(colAllPersons4);ForAll(colAllPersons3,Collect(colAllPersons4,First(Filter(colAllPersons2,Email=Result))));
ClearCollect(colAllPersons5,Sort(colAllPersons4,DisplayName));


For the Items in the Gallery:

Sort(
 GroupBy(
 AddColumns(
 colMyChoices,
 "MCT",
 With(
 {
 wMCT: 
 Concat(
 MultiChoiceTest,
 Value & ", "
 )
 },
 Left(
 wMCT,
 Len(wMCT) - 2
 )
 )
 ),
 "ID",
 "MCT",
 "OtherData"
 ),
 ID
)

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You need not create so many duplicate tables (collections) of your Data.

    You can set your Items property of your dropdown to the following:

    Sort(
     ForAll(
     GroupBy(
     Ungroup(
     ForAll(SPList,
     {Items: Owners}
     ),
     "Items"
     ),
     "Email", "_people"
     ),
     Patch(First(_people), {Email: Email})
     ),
     DisplayName
    )

     

    As for your Items - can you describe more about what you are trying to achieve.  What is colMyChoices and what is MultiChoiceTest?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @RandyHayes , yes, your example is easier to understand. The dropdown is now populated with the list of owners.

    Now how do I make it so that when I select an Owner (or multiple Owners) from the dropdown, the gallery filters and only shows the items related to that Owner?

     

    The code for the Items in the Gallery I shared is only an example. That's the only thing I found online and I'm not sure how to apply it.
    I've tried the usual stuff that works with a simple field like this:

     

    Sort(Filter('SPList',
    If(!IsBlank(ComboBox4.SelectedItems),Owner.DisplayName=ComboBox4.SelectedItems.DisplayName,true),Ascending))

     

    I obviously have to account for a table to table conversion like you did for the dropdown but I have a hard time coming up with a proper syntax.


  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Update: Surprisingly I almost got it working using:

    If(!IsBlank(ComboBox4.SelectedItems), ComboBox4.Selected.DisplayName in Owner.DisplayName,true),

     

    However, this only works if I select a single Owner in the dropdown. If I select multiple ones, the Gallery only filters based on the last Owner I add in the dropdown instead of all Owners that are added in the dropdown.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard