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

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,989 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
    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

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