Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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

(1) ShareShare
ReportReport
Posted on by 279
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?
  • WarrenBelz Profile Picture
    146,635 Most Valuable Professional on at
    How do i patch a multi select person column without deleting previous entries?
    You will find what I posted is much simpler and does not leave a collection "hanging around" in the app resources.
  • Verified answer
    Spawn10 Profile Picture
    279 on at
    How do i patch a multi select person column without deleting previous entries?
    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. 
  • Suggested answer
    WarrenBelz Profile Picture
    146,635 Most Valuable Professional on at
    How do i patch a multi select person column without deleting previous entries?
    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
  • Suggested answer
    AmínAA Profile Picture
    1,084 Super User 2025 Season 1 on at
    How do i patch a multi select person column without deleting previous entries?
    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!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard