cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper III
Helper III

Re: Lookup Office user and update a Sharepoint People

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
Highlighted
Helper III
Helper III

Re: Lookup Office user and update a Sharepoint People

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.

Highlighted
Helper III
Helper III

Re: Lookup Office user and update a Sharepoint People

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

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,944)