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 to patch all recor...
Power Apps
Suggested Answer

How to patch all records multi select choice column?

(0) ShareShare
ReportReport
Posted on by 4
Hello Power App Devs,

Is it possible to patch a new choice in a multi select choice column for all records? 
 
My data source is a dataverse table, where i added the new choice to the choice column.
 
Greatly appreciated.
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Yes that is possible! Before that, just make sure you have refreshed the data source in the app after adding the new choice in your Dataverse choice column.
     
    Here's how you can do it - 
    1. Add a Gallery on the screen with the Dataverse Table in the Items property
    2. Add a button to the screen with the following code:
    ForAll(
        Gallery.AllItems As Item,
        Patch(
            DVTable,
            Item,
            {choice: [choice.NewItem]}
        )
    )
    That's how you will be able to update all the records with the new choice added.
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Miguel Power Profile Picture
    4 on at
    Hi Nandit, thank you for the reply but that didn't work for me.

    Also, the choice(s) i want to add are selected in a combo box.

    I have tried with this code in a button:
     
    ClearCollect(
        Ac,
        AllowedUsersLists
    );
    ForAll(
        Ac,
        If(
            LookUp(
                AllowedUsersLists,
                UserEmail = Ac[@UserEmail],
                "OK"
            ) = "OK",
            Patch(
                AllowedUsersLists, LookUp(
                AllowedUsersLists,
                UserEmail = Ac[@UserEmail]),
                {AvailableModels: ComboBox1_2.SelectedItems}
            )
        )
    );
    Refresh(AllowedUsersLists);
     
    But it updated all the records choice column with the selected items instead of adding to the existing choices.

    I tweaked your code but it gave me the same result, only updating with the selected items, not adding to the existing choices.
     
    ForAll(
        Gallery1.AllItems As Item,
        Patch(
            AllowedUsersLists,
            Item,
            {AvailableModels: [ComboBox1_2.Selected]}
        )
    );
    And also with this giving the same results:
     
    ForAll(
        Gallery1.AllItems As Item,
        Patch(
            AllowedUsersLists,
            Item,
            {AvailableModels: ComboBox1_2.SelectedItems}
        )
    );

    Any thoughts?

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 765 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 272

Last 30 days Overall leaderboard