cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dropdown item in different color : Canvas app

Hi,

 

I want to select different dropdown options filled with different colors (coming from sharepoint list) on a drop down button on Canvas app. Please suggest how to do it without gallery control.

 

Listname: 'Status'

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

Title Values are : One, Off, Pause.

 

Red: On || Green: Off || Pause: Grey

 

Thank you in advance !

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You cannot change the colours of individual items of a drop-down (or Combo Box) except the selected item.

You could do this in a gallery (which you do not want) that you can make look a lot like a drop-down.

 

Please click Accept as solution 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 Thumbs Up.

GarethPrisk
Resident Rockstar
Resident Rockstar

You can accomplish this using a Gallery, as you noted. To be clear (which I think you realize), there is no way to have a Drop Down have different color choices.

 

For the Gallery approach

  • Add a blank Gallery control
  • Add Status as your Items property
  • Add a label to the Gallery, and set the following properties
    • Text: ThisItem.Title
    • Fill: Switch (ThisItem.Title, "On", Red, "Off", Green, "Pause", Grey)

You can then tweak things as need - including sizing and whatnot. You can also optionally put that Switch function as the TemplateFill property of the Gallery, to have the entire gallery row's fill be the color.

Anonymous
Not applicable

@GarethPrisk  Thank you so much for your quick response.

 

I followed your steps and able to set it up. But I can find it as a dropdown: to select from the drop down. Could you please help me here ? I am grateful. 

 

I end up doing it like this, as attached.

Another cool suggestion might be - in my example a dropdown list for approving : 

on property "Fill"
If(
      DataCardValue46.Selected.Value = "Approved",
      Green, 
      DataCardValue46.Selected.Value = "Rejected",
      Red,
     White
)
and if you want it you can set it on "View" (displaymode property) if you want the dropdown value pre-filled.

 

I have a short .gif as well attached. Hope it is ok. (backup url: https://i.postimg.cc/gkjPY1FD/example.gif )

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,476)