cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cperry07
Helper I
Helper I

Condition Text Color in Email

Hello,

 

I have created  PowerApp that allows users to conduct a Health Check for various websites they are responsible for. I am trying to have the results of the test be Emailed to their team members. Within the Email I would like to condition the text color so if the result is "Pass" the text is displayed in green, and if the test result is "Failed" then the text would show in read.

 

Thanks

Chris

5 REPLIES 5
NiloferA
Super User
Super User

Hello @cperry07 ,

Are you using Power Automate to send the email? Assuming that you are, you can send the result to the Power Automate Flow, Pass or Fail and then have a condition in your Flow.

If the result is Pass, Send the email with green text else send an email with Red

 

NiloferA_1-1623738744258.png

Let me know if you have any questions

cperry07
Helper I
Helper I

Hello,

 

Yes I am using Power Automate to generate the E-Mail. The issue with this solution is that I have multiple websites they are checking for pass or fail. So there is not just one condition that would apply. Maybe i'm overlooking this?

 

Thanks for the help!

Chris

Hello @cperry07 ,

You need to figure out when should the email be triggered?

Users conduct Health Checks for various websites, do they submit results per web site or multiple web site data can be submitted in one go?

In any case, you need to configure appropriate conditions in the Power Automate Flow to send the email.

I hope I am making sense here, or you can provide more details about your Power App and Flow and I will be able to help you better.

cperry07
Helper I
Helper I

Multiple web site data can be submitted in one go. 

cperry07_0-1623867466174.png

 

The person conducting the Health Check will select from a dropdown whether the site fails or passes. They will then submit the record, which is submitted into a SharePoint list. From there I am using Power Automate to generate an email. I can achieve the email to be written, I just need to understand how to change the color of the text based on the result of Health Check.

 

cperry07_1-1623867722790.png

 

Hope this clarifies my issue a little better.

Hello @cperry07 , 

I get the functionality of your system, now for the email sending, I am guessing your Power Automate runs when an item is created?

Then, do you want to notify the Team Members of all the site status in one email? If so, then you can do the following

  1. Initialize a string variable with below value
    1. <p>Hi</p>
  2. Then add conditions for each column, if the value is Pass, add Append to String Variable action and pass the below value
    1. <p><span style="color:green"> [Your Site Name]: PASS</span></p>
  3. Else, add an Append to String Variable and pass the below value
    1. <p><span style="color:red">[Your Site Name]: FAIL</span></p>
  4. After all the conditions, add Send an Email action and pass this variable in it

NiloferA_0-1623868751066.png

Of course you ca modify the html as you need, Let me know how this works for you!

Please give a Kudo if you found this helpful or Accept this Reply as Solution if it solved your problem!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,277)