cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
toby95
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
LRVinNC
Resident Rockstar
Resident Rockstar

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

6 REPLIES 6
LRVinNC
Resident Rockstar
Resident Rockstar

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.
LRVinNC
Resident Rockstar
Resident Rockstar

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.
LRVinNC
Resident Rockstar
Resident Rockstar

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.
toby95
Frequent Visitor

This works great, thanks for your help!

what if the Item that we are checking against is boolean type?

Hi, My Power Apps concern is the same idea with this but the Items are a bit extensive. I'm working on cascading checkboxes, Can I format the Child checkbox Fill using its lookup Category value on my SharePoint List same as the Parent Fill (Category)?

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,450)