cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AylardJ
Frequent Visitor

Navigating Collection from SharePoint List with Person "Allow Multiple Selections" Enabled

I think I'm skating around the edges of something that should be obvious, but I haven't figured it out yet. I have found similar questions asked before, but as applied they don't seem to be the answer.

 

My question: I am creating a collection from a SharePoint list that includes a People column that has the "Allow Multiple Selections" option enabled. So, in other words, the People column can potentially be an array, and even single-entry records are treated as an array, from what I can tell.

 

I want to perform a LookUp against the Claims property of each Person entry in a specific row to see if it matches a particular individual based on email address, and then extract the DisplayName property for that Person entry. When I have the "Allow Multiple Selections" option disabled, this is fairly easy: 

 

 

LookUp(
  MyCollection,
  Person.Claims = "i:0#.f|membership|" & strTargetEmail,
  Person.DisplayName
)

 

 

But when that Person entry is an array, this doesn't work. I think the answer is probably pretty straightforward, but I can't see the forest for the trees. Can someone help clear up my confusion? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AylardJ 

Sorry...completely missed the "Multi-Person" part of this:

In this case you kind of have to double lookup...once for the initial record and then to find the record in that record.

So:

With({_users:LookUp(MyCollection, "i:0#.f|membership|" & strTargetEmail in Person.Claims).Person},
    LookUp(_users, "i:0#.f|membership|" & strTargetEmail in Claims, DisplayName)
)

Should give you what you want. 

_____________________________________________________________________________________
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.
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

4 REPLIES 4
RandyHayes
Super User
Super User

@AylardJ 

Please consider changing your Formula to the following:

LookUp(
  MyCollection,
  "i:0#.f|membership|" & strTargetEmail in Person.Claims,
  Person.DisplayName
)

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes, thank you for your reply and your suggestion. This has gotten me closer, but the value, which I expected to be a string, is being returned as a table. When I look at the variable I've created to hold that value, I can drill down to find that the lone value contained in the table is the DisplayName that I expect. What additional step do I need to take to return the value as a string and not embedded in a table? 

RandyHayes
Super User
Super User

@AylardJ 

Sorry...completely missed the "Multi-Person" part of this:

In this case you kind of have to double lookup...once for the initial record and then to find the record in that record.

So:

With({_users:LookUp(MyCollection, "i:0#.f|membership|" & strTargetEmail in Person.Claims).Person},
    LookUp(_users, "i:0#.f|membership|" & strTargetEmail in Claims, DisplayName)
)

Should give you what you want. 

_____________________________________________________________________________________
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.
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

@RandyHayes, that was the solution. Thank you!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,795)