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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Conditional color form...
Power Automate
Answered

Conditional color formatting html table column- Possible?

(0) ShareShare
ReportReport
Posted on by

I have created html table through flow, is there a way to conditional color formatting depending upon the status as shown below and send through email?

exp.JPG


emailcol.JPG

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @sgr ,

     

    Please refer to this article to achieve your requirements:

    https://alextofan.com/2019/02/14/flow-how-to-change-the-style-of-your-html-table-in-flow/

     

    Best Regards,

  • Verified answer
    sgr Profile Picture
    on at

    found more easier way through replace function. Thanks Laxmi Narayan. 

    here is for others who are looking similar;

    replace(body('create_html_table'),'td>Risk','td style="color:red">Risk')

  • ainniss Profile Picture
    8 on at

    I got the replace to work, but it removed the other formatting from my table.

     

    I am not an expert with HTML. Can you advise where I should insert the replace(body........ expression.

     

    See the format of my HTML table below.

     

     

    <style>
    table {
    border: 1px solid #1C6EA4;
    background-color: #ffffff;
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    }
    table td, table th {
    border: 1px solid #AAAAAA;
    padding: 10px 10px;
    }
    table tbody td {
    font-size: 15px;
    }
    table thead {
    background: #813f98;
    border-bottom: 2px solid #444444;
    }
    table thead th {
    font-size: 20px;
    font-weight: bold;
    color: #FFFFFF;
    border-left: 2px solid #D0E4F5;
    }
    table thead th:first-child {
    border-left: none;
    }
    </style>

  • sgrpdl Profile Picture
    109 on at
    @ainniss Plz be little clear, what format is being removed?
    Well you can create another find and replace condition just beneath the 1st one to mitigate the issues.

    replace(outputs(
    'FormatTable'),'<th>','<th style="padding:2px">')
  • ainniss Profile Picture
    8 on at

    Hi 

     

    I guess my question should be, does the replace expression go within the Compose action for the HTML table format. or do I add another action which would be Compose 2 with replace(body'Create_html_table.....

     

    In the first instance the replace(body worked for the text colour change but ignored all other table formatting.

    In the 2nd instance the 2nd compose duplicated the HTML table.

  • sgrpdl Profile Picture
    109 on at

    🙂  This way... @ainniss 

    sgrpdl_0-1636977094683.png

     

     

  • ainniss Profile Picture
    8 on at

    In my Data operations I do not have Format Table and Style table as options. I only have Compose.

     

    I will attempt to use the 'Compose' for the replace to style the table but then do I replace all instance of they symbol { with <           ???

  • sgrpdl Profile Picture
    109 on at

    @ainniss Ya, you have do every thing in compose...

    which can be renamed later as Format Table and Style...

     

  • sgrpdl Profile Picture
    109 on at

    @ainniss 
    https://www.youtube.com/watch?v=FZGHmDlI-o4

     

    I assume you are trying to do some thing similar like above? Have a look..

  • ainniss Profile Picture
    8 on at

    Hi I actually used this video to help with the original table formatting. I need to add conditional formatting to that same table.

    I have a R.A.G. column in the table where the values will either be R for red, A for amber(yellow) or G for green so based on the letter I need the colour to change.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard