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 / Check if the same name...
Power Apps
Answered

Check if the same name is in 2 separate multiple selection people picker fields

(0) ShareShare
ReportReport
Posted on by 249

I was able to check if a name in a single people picker field was in a multiple selection people picker field (Thank you @RandyHayes). 

 

Unfortunately that same syntax does not work to compare if the same name is in 2 multiple selection people picker fields. I have been trying and can get their somewhat with 

 

If(
 CountRows(DataCardValue3.SelectedItems) = 2 && !IsBlank(
 Filter(
 DataCardValue3.SelectedItems,
 Claims in DataCardValue1.SelectedItems.Claims
 
 )) || CountRows(DataCardValue3.SelectedItems) = 1 && DataCardValue3.Selected.Claims in DataCardValue1.SelectedItems.Claims,
 "Nominator may not be a Team Member",
 Parent.DisplayName
)

 

 

The only thing is, this does not update when I remove the duplicate value from only 1 people picker. I have even modified to put in the OnChange and OnSelect properties for DataCardValue1, but receive the same results. 

 

Has anyone else been able to get this working?

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @techtudoor 

    You are ANDing and ORing without really providing the order of precedence that you want.  PowerApps would not be able to presume when to And and when to Or.

    You don't need any OnChange or OnSelect actions.  I assume this formula is still on your ErrorLabel control in the datacard!!??

    The !IsBlank on the Filter is not going to work for you properly either.

     

    In the last post, the scenario seemed much different, so could you elaborate more on which DataCardValue control is which in your app?

  • techtudoor Profile Picture
    249 on at

    @RandyHayes ,

     

    What I would really like is to have a the text change to "Nominator may not be a Team Member", if any of the people in DataCardValue3.SelectedItems.Claims are also in DataCardValue1.SelectedItems.Claims. I was using the || operator because I was able to check if only 1 person was in DataCardValue3.SelectedItems.Claims. 

     

    DataCardValue3 only allows 2 people to be selected. DataCardValue1 allows up to 10 people to be selected.

     

    So if JoeSmith is in DataCardValue3, and is then added to DataCardValue1, the message should appear. I will then also add this to the DisplayMode for the button.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @techtudoor 

    If I'm following you properly, then your formula should be:

    If(
     CountRows(Filter(ForAll(DataCardValue3.SelectedItems, Claims in DataCardValue1.SelectedItems.Claims), Value)>0,
     "Nominator may not be a Team Member",
     Parent.DisplayName
    )
    
  • Verified answer
    techtudoor Profile Picture
    249 on at

    Thank you @RandyHayes . However my colleague was able to come up with a working solution as well.

     

    If( 
     CountIf(DataCardValue3.SelectedItems.Claims, ThisRecord in DataCardValue1.SelectedItems.Claims) > 0, 
     "Nominator may not be a Team Member",
     Parent.DisplayName
    )

     

    This worked for us. I really appreciate your assistance

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard