Patch Write in SharePoint Person Column Using Power Apps
Understanding how to effectively use the patch write function in Power Apps, particularly with SharePoint Person Columns, can be a game-changer for app developers. In this guide, we’ll explore how to modify the “EmployeePerson” column from being blank to representing an individual named “Matthew Devaney” in a SharePoint list.
Objective
The primary aim is to modify the EmployeePerson column, which is of type Person, from being blank to “Matthew Devaney” in a SharePoint list titled “Project Tasks”.
Initial State
ID | TaskName | DueDate | EmployeePeople |
---|---|---|---|
1 | Write project plan | 11/7/2020 |
Using Patch Function
Below is the code using the patch function to achieve our objective:
Patch(
'ProjectTasksList',
LookUp('ProjectTasksList', TaskID=1),
{
PersonnelColumn: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|[email protected]",
Department: "",
DisplayName: "Matthew Devaney",
EmailAddr: "[email protected]",
JobPosition: "",
Img: ""
}
}
)
Result
ID | TaskName | DueDate | EmployeePeople |
---|---|---|---|
1 | Write project plan | 11/7/2020 | Matthew Devaney |
Scenario: Using ComboBox
Here, we illustrate how to patch a value found in a combo box to a People field:
ComboBox Properties Code
Items: Choices('PatchFunctionExamples'.PersonnelColumn)
DisplayFields: ["DisplayName"]
SearchFields: ["DisplayName"]
Patch Function Implementation
Patch(
'ProjectTasksList',
LookUp('ProjectTasksList', TaskID=1),
{
PersonnelColumn: ComboBox_PersonData.Selected
}
)
If you have questions, or if you’d like additional technical assistance, don’t hesitate to contact us. Our team is eager to help and guide you further, and if required, offer you specialized services at competitive rates.
Conclusion
Mastering the patch write function for SharePoint’s Person column using Power Apps can greatly simplify and streamline your app’s operations. We hope this guide aids in your development journey. Remember, always feel free to reach out for any support you might need.