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 / Use Combo box with col...
Power Apps
Answered

Use Combo box with color items to set a variable (color picker)

(1) ShareShare
ReportReport
Posted on by 166

I want to use a combo box to set a variable that will contain the color selected from the combo box.

 

ComboBox Items are = [LightGoldenRodYellow, LightBlue, LightSeaGreen]

 

When i hit the drop down in the combobox, i get a list of values instead of the color names .

 

How do I set a variable to the value selected in the combo box, so i can then use this variable as the color source for a Fill property.

 

Thanks

Dave 

Categories:
I have the same question (0)
  • Verified answer
    Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Daved1 

     

    Set your items to:

     

    [
    {Name:"LightGoldenRodYellow", Colour: LightGoldenRodYellow},
    {Name:"LightBlue", Colour: LightBlue},
    {Name:"LightSeaGreen", Colour: LightSeaGreen}
    ]

     

    So you have both the colour and the colour name in text - one for your dropdown and the other for setting the variable in OnSelect of CB with: Set(varcolour, Self.Selected.Value.Colour)

     

    Hope this helps

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Daved1 

     

    Do it simply like this:

     

     

    ColorValue(Dropdown2.Selected.Value)

     

     

    Put the above in the Color property of what you want to change the color of dynamically based on the other Dropdown value.

     

     See if it works for you

     

    Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-colors#built-in-colorshttps://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-colors

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Daved1,

    Have you solved your problem?

    Do you want to make the color source populated with the Combo Box selected color?

     

    You just need to keep the Combo Box Items setting and set the Fill property as below:

    ComboBox2.Selected.Value

    vqiaqimsft_0-1638774894217.png

     

  • Daved1 Profile Picture
    166 on at

    Thanks for your reply.  I got this to work.  I just had to replace your Name: with Value: for Combobox to work.

     

    For cboColourPicker2.Items set to

    [
    {Value:"Light Golden Rod", Colour: LightGoldenRodYellow},
    {Value:"Light Blue", Colour: LightBlue},
    {Value:"Light Sea Green", Colour: LightSeaGreen}
    ]

     

    Then i have a circle and the fill property i set to - cboColourPicker2.Selected.Value.Colour

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Great work👍 - Good luck with the rest of your build

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard