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 / PowerApps Multi People...
Power Apps
Unanswered

PowerApps Multi People Picker Collection - How to Distinct on Claims but keep DisplayName and Email values

(0) ShareShare
ReportReport
Posted on by 6

I have a collection "emailDistro" that accepts values from a People Picker dropdown as well as adds in the current user. This is done to ensure that the current user is always added to the people picker when they navigate to the next step or if they remove their name and navigate back. 

 

ClearCollect(emailDistro,DataCardValue2.SelectedItems,
 
Table({
DisplayName: Office365Users.MyProfileV2().displayName,
Email: Office365Users.MyProfileV2().mail,
Claims: "i:0#.f|membership|" & Office365Users.MyProfileV2().mail
}));

 

However, this can create a duplicate of the current user.  I need to distinct on the emailDistro collection. However, when I do this it puts the results into a "Value" column when I add it back into the emailDistro collection. 

 

 

ClearCollect(tempEmailDistro,ForAll(Distinct(temp1emailDistro,ThisResult),Value));

 

 

How can I keep my emailDistro record whole wile removing duplicates?

 

The DataCardValue2.SelectedItems the values from this are not consistent with the values that come from User(). For example User().Email is all lowercase while DataCardValue2.Selected.Email is camelcase. The "Claims" value seems to be the field I need to disctinct as that has consistency. 

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @vankootens,

     

    Why not first check if the user is already in the collection before adding them:

    ClearCollect(emailDistro,DataCardValue2.SelectedItems);
    If(
     Not(
     "i:0#.f|membership|" & Office365Users.MyProfileV2().mail in emailDistro.Claims
     ),
     Collect(
     emailDistro, 
     Table({
     DisplayName: Office365Users.MyProfileV2().displayName,
     Email: Office365Users.MyProfileV2().mail,
     Claims: "i:0#.f|membership|" & Office365Users.MyProfileV2().mail
     })
     )
    );

     

  • vankootens Profile Picture
    6 on at

    Yes that is it! Thank you!

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard