How To Patch A SharePoint Person Column In Power Apps

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|[email protected]",
           Department: "",
           DisplayName: "Nagalingam Ravishankar",
           Email: "[email protected]",
           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.

How To Patch A SharePoint Person Column In Power Apps

ComboBox Properties Code

Items: Choices('[@Meeting Request'].RequestedBy)
DisplayFields: ["DisplayName"]
SearchFields: ["DisplayName"]

Patch Function Code

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.