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 / How to Patch condition...
Power Apps
Answered

How to Patch conditionally according to ComboBox selection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

Just a newbie here.

 

I have a combobox, which give user to select e.g  A,B,C,D,E,F
My DataResource is a SPO list, it has Name:A, ID:1, Color: x1.

Name:B, ID:2, Color: x2.

Name:B, ID:3, Color: x3.

Name:C, ID:4, Color: x4.

Name:D, ID:5, Color: x5.

Name:E, ID:6, Color: x6.


How I Bulk update the color according to combobox selection?
E.G.

User Choose A and B in ComboBox, then color(dropDown box) chose to y1, Click the button.
So only Name = A and B 's color will changed with Color:y1.

Please help!!!Much appreciated.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Myhorsejacket52 ,

     

    You can try a combination of Patch and ForAll.

     

    The below example assumes the Color field is a Single Text Column. Apply this expression to the OnSelect property of a Button for example:

     

    Patch (
     'Your Data',
     ForAll(
     'your combo box'.SelectedItems,
     {
     ID: ID,
     'your color field': 'your dropdown'.Selected.Value
     }
     )
    )

     

     

    The below example assumes the Color field is a single Choice Column, and the items property of the dropdown field uses the Choices function. E.g. Choices[@'Your Data'].'Your Color Field').

     

    Patch (
     'Your Data',
     ForAll(
     'your combo box'.SelectedItems,
     {
     ID: ID,
     'your color choice field': 'your dropdown'.Selected
     }
     )
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Myhorsejacket52 ,

     

    You could consider using UpdateIf  to batch update records:

    UpdateIf(SPOList,Name in NameComboBox.SelectedItems.Name,{Color:ColorDropDown.Selected.Color})

     

    Best Regards,

    Bof

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard