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 / Applying Color to Cond...
Power Apps
Answered

Applying Color to Conditional Formatting from a List

(0) ShareShare
ReportReport
Posted on by

I have a SharePoint list that populates some forms.  I'd like label controls to change color when a an item is selected from a dropdown.  

For instance, if I choose, Item B on my form, then I'd like a separate label control to change to RGBA(166,25,46,1); if I choose Item F, then I'd like it to change to RGBA(130,138,231,1), etc. 

 

Can I do that from a list and if so, would you please provide me with an example formula. 

 

Thank you.  

 

Color Question.JPG

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @CindyZ 

    You may want to consider storing your colors as Hex values in the SharePoint list and using the Color Value function to display them.  I wrote an article explaining how to do it which  I’ll link to below:

    Link to ColorValue vs RBGA function article:

    https://matthewdevaney.com/whats-the-difference-between-these-powerapps-functions/

     

    If you need more guidance I can follow up with additional instructions for conditional formatting later.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    CindyZ Profile Picture
    on at

    @mdevaney  Thanks so very much for both the help and the quick reply!  I had no idea so I appreciate your pointing me to your article.  I'll be reading it right away!  Love the cat photo!!! 

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

    Hi@CindyZ,

    Based on the issue that you mentioned, do you want to color the Label based on Text string like RGBA(166,25,46,1)?

    I have made a test on my side where there is no way to achieve this currently in the PowerApps.

    We can easily substitute the RGBA Text string using the following formula:

     

    LookUp(SPlist,Item=Dropdown1.Selected.Result,'Color RGBA')

     

    However, it's Text value while the Fill property expects a Color value. Theoretically, we can translate this into a Color value. ColorValue() seems to work while it only supports CSS color name(e.g."RoxyBrown"), or a 6-digit hex value(e.g. "#ffd700"), or 8-digit hex value(e.g. "#ff7f5080"). 

    You can click the article here for more details.

    As an alternative solution, you can store the color as CSS Color Name, or a 6-digit hex value, or an 8-digit hex value, then you can refer to it in the ColorValue().

    Best Regards,

    Qi

     

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard