PATCH A SharePoint Person Column In Power Apps



Goal

Change the EmployeePerson column (Person Type) from blank to “Matthew Devaney” in a SharePoint list.


Input

Project Tasks (SharePoint List)

IDTaskNameDueDateEmployeePeople
1Write project plan11/7/2020


Patch Function Code
Patch( 'Project Tasks', LookUp('Project Tasks', ID=1), { EmployeePerson: { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|[email protected]", Department: "", DisplayName: "Matthew Devaney", Email: "[email protected]", JobTitle: "", Picture: "" } } )Code language: JavaScript (javascript)


Output

Project Tasks (SharePoint List)

IDTaskNameDueDateEmployeePeople
1Write project plan11/7/2020Matthew Devaney




Scenario #1: ComboBox

Patch a value found in a combo box to a People field.



ComboBox Properties Code
Items: Choices('PATCH Function Examples'.EmployeePerson) DisplayFields: ["DisplayName"] SearchFields: ["DisplayName"]Code language: JavaScript (javascript)


Patch Function Code
Patch( 'Project Tasks', LookUp('Project Tasks', ID=1), { EmployeePerson: ComboBox_Person.Selected } )Code language: JavaScript (javascript)