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 } )
Thanks it works but when loading hte submitted items from the SharePoint list it requires reselecting of the users. Any idea on how to fix this?
Thank you!