cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jltitus
Helper III
Helper III

Filtering two galleries by a people or group column

I'm trying to figure out how to filter one gallery (Project_1) by the People or group column of another gallery and having a heck of a time trying to figure it out. I'm working on an app with two different SharePoint lists. Each list uses the People or Group column type. 

I've tried: 

  • Filter(Projects,Requester=ContactInfo.Selected.SPName.DisplayName)
  • Filter(Projects,Requester=ContactInfo.Selected.value)

I've even tried to add a column to the projects that's a lookup field to clients and tried filtering the projects that way with negative results. 

I'm sure I'm missing something simple. Any assistance would be helpful.

 

SharePoint list namePeople or Group columnGallery name
ClientsSPNameContactInfo
ProjectsRequesterProject_1

 

Contact.jpg

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Jltitus 

So the comparison is on the Email and not the name.  This is important as names can duplicate, but emails are unique.

 

What is important is the letter case of the email.  Sometimes they are not what you expect.  So, you can change your formula to the following:

Filter(Projects, StartsWith(Requester.Email, ContactInfo.Selected.SPName.Email))

 

Also, I did not focus on your ContactInfo control as a source of issue, but I assumed it was set to the Client list as that was the one you indicated had the SPName column in it.  So I assume that is all correct.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

11 REPLIES 11
RandyHayes
Super User
Super User

@Jltitus 

Please consider changing your Formula to the following:

Filter(Projects, Requester.Email = ContactInfo.Selected.SPName.Email)

Comparing record to record is an issue, but a column in that record called Email should match.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Well, that doesn't throw an error but it's also not returning the "NexGen SAG Training" tied to Ronda. I've confirmed her name is in both lists as well.

RandyHayes
Super User
Super User

@Jltitus 

So the comparison is on the Email and not the name.  This is important as names can duplicate, but emails are unique.

 

What is important is the letter case of the email.  Sometimes they are not what you expect.  So, you can change your formula to the following:

Filter(Projects, StartsWith(Requester.Email, ContactInfo.Selected.SPName.Email))

 

Also, I did not focus on your ContactInfo control as a source of issue, but I assumed it was set to the Client list as that was the one you indicated had the SPName column in it.  So I assume that is all correct.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

That did it.. THANK YOU so much.

RandyHayes
Super User
Super User

@Jltitus 

Yes...so there was a case difference between the two.  The StartsWith ignores case.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Would the filter be different if the ContactInfo gallery is a ClientDetailsForm instead w/ the same fields?

RandyHayes
Super User
Super User

@Jltitus 

Not really...as long as you are comparing the same type of information.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Interesting, I just tried replacing "ContactInfo" with "ClientDetailsForm" and it errors.

RandyHayes
Super User
Super User

@Jltitus

What is ClientDetailsForm and what column and column type are you trying to compare?  What is the formula as well?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,634)