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 / Managing items with a ...
Power Apps
Unanswered

Managing items with a Dropdown in a gallery

(1) ShareShare
ReportReport
Posted on by 16
I have a dropdown column in a Power Apps gallery with three choices Red, Blue and Green. The user can select maximum two Red out of all items in the gallery, the rest of the items must have either Blue or Green selected. On save of the gallery this column is saved in a Single line of Text column called Color in a Dataverse Table.
 
The user should be able to change the color of any row any time but the maximum rows with selected Red will never be more than two.  Rest must be Blue or Green. The user should be able to change the color in the Gallery items in future also with the condition being that maximum row with Red cannot be more than two.
 
How best to achieve this.... 
 
 
 
 
 
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    It seems that you have to keep track of how many items are red. You can maintain a count in a configuration table which you will read when you open the screen containing the gallery or you can count the number of red items when you open the screen. 
    When you change an item's colour you should disable the red option if the maximum of red items has been reached. Before saving colour changes you need to ensure that no one else has already changed the items.  
  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at
    Hi​​​​​​​ jaimat1
    Using a Combo Box (not a drop down), put this OnChange
    UpdateContext(
       {
          varRed: 
          CountIf(
             GalleryName.AllItems,
             ComboBoxName.Selected.Value = "Red"
          )
       }
    )
    Then the Items
    If(
       varRed = 2,
       [
          "Blue",
          "Green"
       ],
       [
          "Red",
          "Blue",
          "Green"
       ]
    )
    and at Screen OnVisible or anywhere else you need to reset it
    UpdateContext({varRed: 0})
     
    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
  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard