Today, I’ll share my findings on how to properly set values in SharePoint’s “Person or Group” columns – a common challenge I recently faced and solved.
Objective
While it’s straightforward to set these values using SharePoint forms, I’ll demonstrate how to accomplish this programmatically using the Patch function in Power Apps.
Adding New Items
Patch(
[List Name], Defaults([List Name]),
{
[Column Name]: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & "[Target User Email Address]",
Department: "",
DisplayName: "",
Email: "",
JobTitle: "",
Picture: ""
}
});

Editing Items

Patch(
[List Name],
[Target List Item],
{
[Column Name]: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & "[Target User Email Address]",
Department: "",
DisplayName: "",
Email: "",
JobTitle: "",
Picture: ""
}
});

コメント