cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
toby95
Level: Powered On

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
Super User
Super User

Re: Change Label Text Colour Based on a Condition?

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.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Change Label Text Colour Based on a Condition?

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.

View solution in original post

Super User
Super User

Re: Change Label Text Colour Based on a Condition?

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

Re: Change Label Text Colour Based on a Condition?

Deleted Post (system posted twice for some reason).
toby95
Level: Powered On

Re: Change Label Text Colour Based on a Condition?

This works great, thanks for your help!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 336 members 5,521 guests
Please welcome our newest community members: