cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joshualeond
Frequent Visitor

SharePoint List Update Person Field

I've been working on a form to update a person/group field on a SharePoint List.  I know how to do bulk edits to a list from within PowerApps but cannot figure out how to edit a Person or Group record since it is not a single value.

 

Here is what I'm trying as an OnSelect of a Button:

UpdateIf(List1, true, {Name: Office365Users.MyProfile()})

Where List1 is a SharePoint Online list that I have connected to my PowerApp. 

The error I receive is:

The type Record is invalid for column 'Name'; Record expected.

Any help would be appreciated. Thanks.

3 REPLIES 3
rgruian
Power Apps
Power Apps

The only supported way to do this in PowerApps today is using a Form in conjunction with a lookup control, which will fill in the necessary fields for that Person or Group record. In your case, the reason why the formula is not working is because Office365Users.MyProfile() produces a record whose schema is incompatible with the schema expected by SharePoint.

 

For example, Sharepoint expects something like this for a Person record:

 

  {'@odata.type':text, Claims:text, Department:text, DisplayName:text, Email:text, JobTitle:text, Picture:url}

 

...while the MyProfile() invocation produces something like this:

 

  {AccountEnabled:bool, Department:text, DisplayName:text, GivenName:text, Id:text, JobTitle:text, Mail:text, MailNickname:text, Surname:text, TelephoneNumber:text, UserPrincipalName:text, mobilePhone:text}

 

Radu Gruian [MSFT] ** PowerApps Staff

 

Thanks for the response!

So in an attempt to use a Form and a Lookup I have an Edit Lookup that you can search and select a user from as seen below:

 

Powerapps.PNG

I named the DataSource box above 'Replace'.  After I have selected the Person I then have a button with the following formula:

UpdateIf(List1, true, {Name: Replace.Selected})

And get the same error:

The type Record is invalid for column 'Name'; Record expected.

So in this case I'm assuming the Selected value is a Person type record that would be sent back to SharePoint in the same format that it sends the record to PowerApps.

Do you know if there is a way for me to view the contents of `Replace.Selected` as a record similar to the format you mentioned {Field:type, Field:type, ... }?  That could help me debug my setup.

 

Josh

One easy way to view the record would be to collect it into a temporary collection, and subsequently visualize the collection via the Collections tab.

 

DebugButton.OnSelect = Collect(DebugColl, Replace.Selected)

 

 

 

Radu Gruian [MSFT] ** PowerApps Staff

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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 (60,346)