web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Conditional background...
Power Automate
Unanswered

Conditional background formatting in HTML Table based on cell values

(0) ShareShare
ReportReport
Posted on by 11

Hello,

 

I'm new to Power Automate and I need to apply a conditional formatting in HTML Table based on cell values. I have an excel file in Sharepoint from which the Table is fetched and an email is sent Daily by converting the table from excel to HTML Table. The scenario is we have certain workitems (IDs) which are in 'Active' state highlighted in 'Red' background. And when the 'IDs' are 'Resolved' they are highlighted in 'Green' background. Sharing below the screenshots:

harshjoshiD_0-1659585345161.png

Now I have created a flow which sends this Table as an email daily.

harshjoshiD_1-1659585813495.pngharshjoshiD_2-1659585847615.png

I get the below output

harshjoshiD_3-1659585950138.png

Is there any way I can apply Conditional Formatting to the Table... If State = 'Active' Then Background = 'Red' Else Background = 'Green'. I want 'Active' background to be Red and 'Resolved' background to be green.

It would be really helpful if any of you can help here 🙂

Categories:
I have the same question (0)
  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @harshjoshiD ,

    please refer to the following post:

     

    https://powerusers.microsoft.com/t5/Using-Flows/Conditional-color-formatting-html-table-column-Possible/m-p/642302#M16680

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    BR,

    Marco

  • harshjoshiD Profile Picture
    11 on at

    Using below expression did the trick:

    if(equals(toUpper(item()?['State']),'ACTIVE'),'<span style="backgroundcolor:#FF0000" onLoad="this.parentElement.style.backgroundColor=red";>Active</span>','<span style="background-color:#00FF00">Resolved</span>')

    harshjoshiD_0-1662014417154.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard