Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /gTh3yNQQASXZY/h9Qukr/
Power Apps - Building Power Apps
Answered

Patch multiselect combobox into SharePoint multi person field by retaining existing values.

Like (0) ShareShare
ReportReport
Posted on 23 Oct 2024 22:27:38 by 77
ForAll(
    colUpdate_SharedCollections,
    Patch(
        GS_Shared_Greenhouse,
        LookUp(
            GS_Shared_Greenhouse, ID = colUpdate_SharedCollections[@ID]
        ),
        {
            SharedUsers: cbxUsers_SharedCollections.SelectedItems
        }
    )
)
Hi everyone,
 
The code patches the values from the combobox into SharedUsers(Multi person field in SharePoint). However, it is removing the existing values in "SharedUsers" when I patch it. I would like to retain the existing values, how do I do that?
 
Thanks
  • Verified answer
    narayan225 Profile Picture
    2,434 Super User 2025 Season 1 on 24 Oct 2024 at 00:42:59
    Patch multiselect combobox into SharePoint multi person field by retaining existing values.
    Generally when using combo-box, you render the combo-box with the list of items that are already selected and when you select more items, it patches the existing ones and the new one seamlessly.
     
    Because you want to patch the multi-choice field with both the existing selection as well as the new ones, you will need to first store the existing items in a collection.
    Then, use the selected items property to add new items into that collection and later patch the collection to the multi-choice column in SharePoint.
     
    ClearCollect(existingchoiceslist,LookUp(DataSource,LookUpCondition.Column); //this will store the column data to the existinchoiceslist collection.
    ForAll(existingchoicelist, Collect(choicelist, ThisRecord)); //This is to look out for duplicates
    Collect(choicelist, comboBox.SelectedItems); //This will then create a final collection with both existing value and selected values
    After this you can try and patch the column using the above formula that you provided.
     
    hope this works.

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started