web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch multi people col...
Power Apps
Answered

Patch multi people column in SharePoint

(0) ShareShare
ReportReport
Posted on by 2,567

I have a combo box that has items from a collection created from a Office 365 group.

I then have the following set on my Patch button.

OnSelect:

 

Clear(colSelectedDelegates);
ForAll(
 Selected_Delegates.SelectedItems,
Collect(colSelectedDelegates,
 {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.|membership|" & Lower(ThisRecord.mail),
 Department: "",
 DisplayName: ThisRecord.displayName,
 Email: ThisRecord.mail,
 JobTitle: "",
 Picture: ""
 }
)
);
 Patch(
 MyDataSource,
 ThisItem,
 {
 DelegatesTest: colSelectedDelegates
 }
 )

 

 

This button is on each gallery Item so I refer to ThisItem.

I get an error saying: The request operation is invalid.

I Check my collection and it looks correct.

Categories:
  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @JimmyWork ,

    I would be inclined to do it this way - note I cannot test this presently

    Patch(
     MyDataSource,
     {ID: ThisItem.ID},
     {
     DelegatesTest: 
     ForAll(
     Selected_Delegates.SelectedItems As aPatch,
     {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "1:0#.|membership|" & Lower(aPatch.mail),
     Department: "",
     DisplayName: aPatch.displayName,
     Email: aPatch.mail,
     JobTitle: "",
     Picture: ""
     }
     )
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • JimmyW Profile Picture
    2,567 on at

    Found a solution.

     

    Patch(
     MyDataSource,
     varSelectedTicket, //This is a variable for ThisItem
     {
     MultiPersonColumn:
     ForAll(
     MyComboBox.SelectedItems ,
     {
     Claims: Concatenate("i:0#.f|membership|" & mail),
     Department: "",
     DisplayName: displayName,
     Email: mail,
     JobTitle: "",
     Picture: ""
     }
     )
     }
    )
  • JimmyW Profile Picture
    2,567 on at

    @WarrenBelz Thank you Warren will test this tomorrow and update with your solution and accept it 🙂

  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    @JimmyWork ,

    I just tend to be more specific with the record to be patched if the ID is available as the data source needs to simply identify the ID rather than having to find the record matching the Variable.

  • Verified answer
    JimmyW Profile Picture
    2,567 on at

    @WarrenBelz Tested your solution and it does not work, I get an error saying: An error occurred on the server.

    But I did update my formula according to your recommendation on specifying ID.

     

    Patch(
     MyDataSource,
     {ID: varSelectedTicket.ID},
     {
     DelegatesTest:
     ForAll(
     SelectedDelegates.SelectedItems ,
     {
     Claims: Concatenate("i:0#.f|membership|" & mail),
     Department: "",
     DisplayName: displayName,
     Email: mail,
     JobTitle: "",
     Picture: ""
     }
     )
     }
    )
  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    @JimmyWork ,

    Same thing - you just need to refer to the ID of the record (I cannot see your data or app). The response was more about the other structure required (which achieved the purpose you required) and then refer to wherever you can get the ID.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard