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 color form...
Power Automate
Unanswered

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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard