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});

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (11,414)