Goal
Change the EmployeePeople column (Person Type) from blank to “Matthew Devaney”, “Sarah Green” and “David Johnson” 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),
{
EmployeePeople: Table(
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|[email protected]",
Department: "",
DisplayName: "Matthew Devaney",
Email: "[email protected]",
JobTitle: "",
Picture: ""
},
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|[email protected]",
Department: "",
DisplayName: "Sarah Green",
Email: "[email protected]",
JobTitle: "",
Picture: ""
},
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|[email protected]",
Department: "Technology",
DisplayName: "David Johnson",
Email: "djohnson@companyname",
JobTitle: "",
Picture: ""
}
)
}
)
Output
Project Tasks (SharePoint List)
ID | TaskName | DueDate | EmployeePeople |
1 | Write project plan | 11/7/2020 | Matthew Devaney Sarah Green David Johnson |
Scenario #1: ComboBox
Patch a value found in a combo box to a People field.
ComboBox Properties Code
Items: Choices('PATCH Function Examples'.EmployeePeople)
DisplayFields: ["DisplayName"]
SearchFields: ["DisplayName"]
Patch Function Code
Patch(
'Project Tasks',
LookUp('Project Tasks', ID=1),
{
EmployeePeople: ComboBox_Person.SelectedItems
}
)
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps articles sent to your inbox each week for FREE