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 / Text label fill colour...
Power Apps
Answered

Text label fill colour depending on choice column value

(0) ShareShare
ReportReport
Posted on by 181

Good morning.


I have a gallery with 4x text labels which I need to be colour coded depending on the value of a dropdown box (choice column SP list) in a form linked to the gallery.

 

The staff manager wants the gallery of staff colour coded depending on their dept, so,

 

If the person belongs to engineering, its needs to be cyan, if the person belongs to IT it needs to be yellow, HR, Green, Admin, orange, and a final option of NA, needs to be white or no colour.

 

I was looking at both If and Switch such as If(thisitem.department.value = "Engineering", Cyan) which works if the engineering option is selected from the dropdown but I need to add the other departments with their colours.


Many thanks

 

Categories:
I have the same question (0)
  • Verified answer
    Ash13 Profile Picture
    576 on at

    Switch makes the most sense here:

    Switch(ThisItem.Department.Value,
    "Engineering",Color.Cyan,
    "IT",Color.Yellow,
    "HR",Color.Green,
    "Admin",Color.Orange,
    Color.White)


    Just FYI when using If, you can have multiple ifs like:

    If(Condition, Result, Condition2, Result2....., ElseResult)

    But when all your conditions are based on 1 value, it's best to use Switch.

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

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard