In this blog, we are going to see how to use the patch function to update a SharePoint Person column in Power Apps.
In a SharePoint list we have a column RequestedBy, our goal is to update a RequestedBy (Person type) from Blank to “Nagalingam Ravishankar”.
Input
Meeting Request (SharePoint List)
ID | RequestedBy | RequestDateTime |
1 | 27/12/2022 10:47AM | 27/12/2022 10:47AM |
Patch Function Code
Patch(
'Meeting Request',
LookUp('Meeting Request', ID=1),
{
RequestedBy: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|ravishankar.nagalingam@companyname.com",
Department: "",
DisplayName: "Nagalingam Ravishankar",
Email: "ravishankar.nagalingam@companyname.com",
JobTitle: "",
Picture: ""
}
}
)
Output
Meeting Request (SharePoint List)
ID | RequestedBy | RequestDateTime |
1 | Nagalingam Ravishankar | 27/12/2022 11:47AM |
There is another way to Patch a value from a combo box to a People field.
ComboBox Properties Code
Items: Choices('[@Meeting Request'].RequestedBy)
DisplayFields: ["DisplayName"]
SearchFields: ["DisplayName"]
Patch(
'Meeting Request',
LookUp('Meeting Request', ID=1),
{
RequestedBy: ComboBoxPerson.Selected
}
)
That’s it, I hope you have seen how to use the patch function to update a SharePoint Person column in Power Apps. Feel free to fill up the comment box below if you need any further assistance.
Find more great Power Platform blogs on Power Platform Week.
About the Author
Working as Software Engineer at Cognizant. I’m a C# Corner MVP, Blogger, and Speaker. Having 5+ years of experience over Microsoft technologies and expertise in SharePoint, Power Apps, Power Automate, C#.NET, Microsoft Azure, IoT, Angular, Python and PowerShell.
Reference
Ravishankar, N., 2022, How To Patch A SharePoint Person Column In Power Apps, Available at: How To Patch A SharePoint Person Column In Power Apps (c-sharpcorner.com) [Accessed on 10 January 2023]