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
Highlighted
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
Highlighted
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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 349 members 6,493 guests
Recent signins:
Please welcome our newest community members: