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 / 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

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
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard