cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tia
Resolver I
Resolver I

Patch Mutliselect People and Group field in SharePoint

Hi All, 

 

I am trying to patch a multi-select people and group field into a SharePoint list. 

 

Field Name: DC_AllStaffR - I added the table around the field as recommended, but I must be missing something as the patch only pushes the last selected person through into SharePoint.

 

Patch(CCB,
Defaults(CCB),
{
Title: DC_NameR.Text,
Date:DC_DateR.SelectedDate,
'Service Type': {Value: DC_ServiceTypeR.Selected.Value},
'Lead Staff':
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & DC_LeadStaffR.Selected.Email, 
DisplayName: DC_LeadStaffR.Selected.DisplayName,
Department:"",
Email: DC_LeadStaffR.Selected.Email,
JobTitle: "",
Picture:""},
'All Staff Present': Table(
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & DC_AllStaffR.Selected.Email, 
DisplayName: DC_AllStaffR.Selected.DisplayName,
Department:"",
Email: DC_AllStaffR.Selected.Email,
JobTitle: "",
Picture:""
})

});

 

DC_LeadStaff is a Single person field and works 100%

 

If anyone has an idea about where I'm going wrong I'd really appreciate it!

 

Thanks in advance, 

Kind Regards,

Tia

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Tia ,

 

All Staff Present field part of code should be modified as follows.

 

'All Staff Present': ForAll(DC_AllStaffR.SelectedItems, 
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & Email, 
DisplayName: DisplayName,
Department:"",
Email: Email,
JobTitle: "",
Picture:""
})

 

Hope this helps.

Sik

View solution in original post

2 REPLIES 2
v-siky-msft
Community Support
Community Support

Hi @Tia ,

 

All Staff Present field part of code should be modified as follows.

 

'All Staff Present': ForAll(DC_AllStaffR.SelectedItems, 
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & Email, 
DisplayName: DisplayName,
Department:"",
Email: Email,
JobTitle: "",
Picture:""
})

 

Hope this helps.

Sik

View solution in original post

Thank you Sik, exactly what I was looking for!!

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (45,620)