Power Apps Save Combo Box with Office 365 Users to SharePoint List’s Person Data

This is a quick post showing how to save Office 365 Users data from the combo box to a SharePoint list. It shows two combo boxes with Office 365 Users – one allowing only one selection, another allows multiple. The former will save to the SharePoint column with the Person data type, the latter to another column with Person data type with allowing multiple selections.

FROM:

TO:

 

 

Clear(colTeamMembers);
ForAll(
    cmbTeamMembers.SelectedItems,
    Collect(
        colTeamMembers,
        {
            '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims:"i:0#.f|membership|" & DisplayName,
            Department:"",
            DisplayName: DisplayName,
            Email: Mail,
            JobTitle:"",
            Picture:""
        }
    )
);
Patch(
    'People Tracker',
    Defaults('People Tracker'),
    {
        Title: "Group A",
        'Primary Contact': {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims:"i:0#.f|membership|" & cmbPrimaryContact.Selected.DisplayName,
            Department:"",
            DisplayName: cmbPrimaryContact.Selected.DisplayName,
            Email: cmbPrimaryContact.Selected.Mail,
            JobTitle:"",
            Picture:""
        },
        'Team Members': colTeamMembers
    }
)
No comments yet.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress. Designed by WooThemes