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

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
Power Apps Staff rgruian
Power Apps Staff

Re: SharePoint List Update Person Field

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

Re: SharePoint List Update Person Field

 

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

Power Apps Staff rgruian
Power Apps Staff

Re: SharePoint List Update Person Field

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
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,144)