cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamesM
Level 8

Multiple conditional statements to change color of text based on text value

Hi all, so thanks to helpful people here I know how to change the color of text based on its value, example here: 

 

 

(Note the 'fill' command).  But what if I want multiple If's? So if "Project" red, if "High" blue etc?

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Level 10

Re: Multiple conditional statements to change color of text based on text value

In Excel, you would need to nest If statements inside one another. In PowerApps, it works more like the Switch function, so you can just chain conditions and results one after another. This reduces the number of If() and parentheses so it's less confusing.

 

Try this:

 

If(TextBox1.Text="Project", Red,
TextBox1.Text="High", Blue,
TextBox1.Text="text that you use for identifying", [name of color or RGBA()] )

Chain more lines as needed.

 

Microsoft Employee
@8bitclassroom
5 REPLIES 5
mr-dang
Level 10

Re: Multiple conditional statements to change color of text based on text value

In Excel, you would need to nest If statements inside one another. In PowerApps, it works more like the Switch function, so you can just chain conditions and results one after another. This reduces the number of If() and parentheses so it's less confusing.

 

Try this:

 

If(TextBox1.Text="Project", Red,
TextBox1.Text="High", Blue,
TextBox1.Text="text that you use for identifying", [name of color or RGBA()] )

Chain more lines as needed.

 

Microsoft Employee
@8bitclassroom
Highlighted
JamesM
Level 8

Re: Multiple conditional statements to change color of text based on text value

Thank you so much I'll try that out Smiley Happy 

Community Support Team
Community Support Team

Re: Multiple conditional statements to change color of text based on text value

Hi @JamesM,

 

Any further help needed on this topic?

If the steps provided by @mr-dang works, would it be convenient for you to Accept it as the solution?

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pinarrehber
Level: Powered On

Re: Multiple conditional statements to change color of text based on text value

Hi, 

 

I have an app where people have to submit dates of tasks assigned to them. They have this issue that after they submit the date and then go back to list they forget which tasks they have already submitted dates. So is there a way to make name of the tasks that dates are submitted change color in list view? Or is there any other solution that can be done to distinguish between tasks in list view.

 

Thanks 

PytByt
Level: Powered On

Re: Multiple conditional statements to change color of text based on text value


@mr-dang wrote:

In Excel, you would need to nest If statements inside one another. In PowerApps, it works more like the Switch function, so you can just chain conditions and results one after another. This reduces the number of If() and parentheses so it's less confusing.

 

Try this:

 

If(TextBox1.Text="Project", Red,
TextBox1.Text="High", Blue,
TextBox1.Text="text that you use for identifying", [name of color or RGBA()] )

Chain more lines as needed.

 


Hi @mr-dang 

Can i use the same formula to visible property, such as:
If(DataCardValue7.Text = "In Progress", true, DataCardValue7.Text = "in progress", true, false) ?

 

please help.

 

thanks.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

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

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

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