Goal
Change the EmployeePerson column (Person Type) from blank to “Matthew Devaney” in a SharePoint list.
Input
Project Tasks (SharePoint List)
| ID | TaskName | DueDate | EmployeePeople |
| 1 | Write project plan | 11/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)
| ID | TaskName | DueDate | EmployeePeople |
| 1 | Write project plan | 11/7/2020 | Matthew 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) Did You Enjoy This Article? 😺
Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE