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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

@RandyHayes, that was the solution. Thank you!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (35,055)