cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Change Label Text Colour Based on a Condition?

I've just started working with PowerApps and having a play around. I deployed a PowerApp based on a list I had created in SharePoint.

 

One of the fields the PowerApp displays is 'Change Criticality'. This can either be 'Low', 'Medium', 'High' or 'Critical'. Is there a way I can apply conditional formatting so that, say, if the value is "critical", the text will show up red?

 

Currently the label is set to 

ThisItem.'Change Criticality'.Value

 

Going further with this, could I also make the browse gallery background change colour based on this condition?

 

Thanks, and sorry if this is an extremely basic question.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

I use this a lot. Here's an example: If(ThisItem.RecordType.Value = "Issue", Orange, ThisItem.RecordType.Value = "Risk", Red, ThisItem.RecordType.Value = "Dependency", Blue, Black) Notice that you only say IF once. It is implied before the additional tests are made. You can use either the color names or the codes for the colors like RGBA(47, 41, 43, 1). The last one (Black) is the default if none of the other tests are met.
LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

I use this a lot. Here's an example: If(ThisItem.RecordType.Value = "Issue", Orange, ThisItem.RecordType.Value = "Risk", Red, ThisItem.RecordType.Value = "Dependency", Blue, Black) Notice that you only say IF once. It is implied before the additional tests are made. You can use either the color names or the codes for the colors like RGBA(47, 41, 43, 1). The last one (Black) is the default if none of the other tests are met.
LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted

I should have noted that this goes in your Color attribute for the field you want to show in color.
LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Highlighted

Deleted Post (system posted twice for some reason).
LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Highlighted

This works great, thanks for your help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,484)