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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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