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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do i patch a multi...
Power Apps
Answered

How do i patch a multi select person column without deleting previous entries?

(1) ShareShare
ReportReport
Posted on by 301
I am trying to update a multi select person SharePoint column with the patch below. This patch statement removes all others already in the column, and then adds only the new one. 
 
Patch(
   myList,
	LookUp(
	  myList, ID = Value(Param("ID"))),
	  {
	    myColumn: Table (
              {
		'odata.typr': "@Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
		Claims: User().Email,
		DisplayName: User().FullName,
		Department: "",
		Email: User().Email,
		JobTitle: "",
		Picture: ""	    
	      })
   	  }      
   );
 
 
How do i get to append the new user into the column, without deleting the previous names in the column?
Categories:
I have the same question (0)
  • Suggested answer
    AmínAA Profile Picture
    1,228 Super User 2025 Season 2 on at
    Greetings Spawn10!
     
    I'm not entirely sure I understand what you're trying to achieve, but If I'm not mistaken, you want your code to concatenate the previous table you had, with a new t able, as in appending the new values to the column as a table after the table you already had . . . If that's the case then this implementation might work, altough I'm not sure since I've never done this one like this before!
    Patch(
        myList,
        LookUp(
            myList,
            ID = Value(Param("ID"))
        ),
        {
            myColumn: 
            Concat(
                myColumn,
                Table(
                    {
                        'odata.type': "@Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                        Claims: User().Email,
                        DisplayName: User().FullName,
                        Department: "",
                        Email: User().Email,
                        JobTitle: "",
                        Picture: ""
                    }
                )
            )
        }
    )
     
    Hopefully this does solve your problem, if that's the case, feel free to mark this reply as an answer, otherwise feel free to reply for further help as well!
  • Suggested answer
    WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Hi  Spawn10,
    You need to get the existing content first, then patch it all back as a Table. Your first part also needs to be converted to this format first.
    With(
       {
          _Record: 
          LookUp(
             myList,
             ID = Value(Param("ID")))
          )
       },
       Patch(
          myList,
          {
             ID: _Record.ID,
             myColumn: 
             Table(
                {
                   Claims: "i:0#.f|membership|" & Lower(User().Email),
                   DisplayName: User().FullName,
                   Department: "",
                   Email: User().Email,
                   JobTitle: "",
                   Picture: ""
                },
                _Record.myColumn
             )
          }
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Verified answer
    Spawn10 Profile Picture
    301 on at
    To patch to the multi select people column in SharePoint, without deleting the users already in the item, this is what I ended up doing...
    //collect current users
    ClearCollect(currentUsers,LookUp(myList,ID = Value(Param("ID"))).myColumn);
    
    //add current user
    Collect(currentUsers
    {
    	'odata.typr': "@Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    	Claims: User().Email,
    	DisplayName: User().FullName,
    	Department: "",
    	Email: User().Email,
    	JobTitle: "",
    	Picture: ""	    
    });
    
    //then patch
    Patch(myList, First(Filter(myList, ID = Value(Param("ID"))))),{myColumn:currentUsers});
    That seems to have done the trick. Still open to learning a better way, if there is. 
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    You will find what I posted is much simpler and does not leave a collection "hanging around" in the app resources.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard