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

Lookup Office user and update a Sharepoint People

Having a moment.  I want to lookup a user profile and patch a Sharepoint list People item (Owner).

 

Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner: Office365Users.UserProfileV2({searchTerm:HomeGalleryEmployees.Selected.'Email Address'})});

1 ACCEPTED SOLUTION

Accepted Solutions

Here is what worked for me:

 

Set(varPersonClaim, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|" & Office365Users.UserProfile(HomeGalleryEmployees.Selected.'Email Address').Mail, Department:"", DisplayName:"", Email:"", JobTitle:"", Picture:""});Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner: varPersonClaim});

View solution in original post

2 REPLIES 2
sjcitpro
Helper III
Helper III

Also tried Set(varPerson, Office365Users.SearchUser({searchTerm:HomeGalleryEmployees.Selected.'Email Address'}));Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner: varPerson}));Set(AddAssetPopup,false)

 

But it's a Record / Table mismatch.  I guess I don't understand.  varPerson is a table but I assumed a Person or Group would also be a table.

Here is what worked for me:

 

Set(varPersonClaim, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|" & Office365Users.UserProfile(HomeGalleryEmployees.Selected.'Email Address').Mail, Department:"", DisplayName:"", Email:"", JobTitle:"", Picture:""});Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner: varPersonClaim});

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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