cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sjcitpro
Level: Powered On

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
sjcitpro
Level: Powered On

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
sjcitpro
Level: Powered On

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.

sjcitpro
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 102 members 4,316 guests
Please welcome our newest community members: