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 / Create formatted table...
Power Automate
Answered

Create formatted table columns based on condition in power automate

(0) ShareShare
ReportReport
Posted on by 30

Hello the forum participants and contributors, 

I am almost new in Power Automate, 

In a Power Automate flow, I get data from a SharePoint list, which grabs a list of reports, if the report status marked as "Yes", I show the status as green, and red otherwise, in the select action of power automate in the report status field, I created this code:"<font color=\"If(equals(item()?['ReportStatus/Value'], 'Yes'), 'green', 'red') field name from dynamic content</font>

but this code only displays this "<font color="green">Yes </font>" instead of coloring it. 

I would appreciate your support in this.

 

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

    Hi , @NaqibDanish 

    We can not format the column color in Power Automate . If you want to set the font color based on the value in SharePoint List , you need to format the column here :

    vyueyunmsft_0-1705895207605.png

     

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
     "elmType": "div",
     "inlineEditField": "[$Your Internal column Name]",
     "txtContent": "[$Your Internal column Name]",
     "style": {
     "color": "=if([$Your Internal column Name]=='Yes', '#00ff00', '#ff0000')"
     
     }}

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • NaqibDanish Profile Picture
    30 on at

    Thank you @yueyun zhang, one of the developer that i follow on Youtube does formatting in power automate, i posted him the error, he says that formatting can be done in Power automate: The link to his youtube video: 

    https://www.youtube.com/watch?v=VnWg-Eox37Q&lc=UgzY_srgg0xCaJeP8Jp4AaABAg.9zr-yIMiRQk9zr0buSSdz5

  • NaqibDanish Profile Picture
    30 on at

    @v-yueyun-msft, where to place the json code, i couldnt really find it?

    Thank you

  • v-yueyun-msft Profile Picture
    on at

    Hi, @NaqibDanish 

    Thanks for the reply, I just came back from lunch!
    What type of column do you have? I'll look at your video and get back to you.
    For json can be put here:

    vyueyunmsft_0-1705900443665.png

     

    Best Regards,

    Yueyun Zhang

     

  • v-yueyun-msft Profile Picture
    on at

    Hi, @NaqibDanish 

    This video use the "Create Html table" to create a html table and add the "<font color="green">Yes </font>" in it . This generated html code is put in the "Send to an email v2" action's body as html code. And this is not format the font color in SharePoint List in my understand.

     

    . If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • NaqibDanish Profile Picture
    30 on at

    @v-yueyun-msft, I appreciate your response. I exactly want the same thing, the only difference is that i don't to send it to email but sending it to a team channel or group. What I did is, I fetched the sharepoint items in powerautomate, based on the reportstatus, first want to color code it, and then send it to a teams channel so that group members can easily recognize by text color which report is pending and which one completed. 

  • v-yueyun-msft Profile Picture
    on at

    Hi , @NaqibDanish 

    Thanks for your quick response! Sou do you mean you use this action in the last?

    vyueyunmsft_0-1705901987185.png

    If this , it can be realized to format the color using html coed, can you share how you flow set in your side?

     

    Best Regards,

    Yueyun Zhang

  • NaqibDanish Profile Picture
    30 on at

    Thank you for the response, yes, exactly, please see my screenshot,

    NaqibDanish_0-1705902371194.png

     

  • NaqibDanish Profile Picture
    30 on at

    This is another screenshot, where i removed the code tag from report status as it was not working:

    NaqibDanish_0-1705902498457.png

     

  • v-yueyun-msft Profile Picture
    on at

    Hi , @NaqibDanish 

    I test it in my side , you can put the <font> tag in the "Create html table" action.

    This is my sharePoint list:

    vyueyunmsft_0-1705903020640.png

    This is my flow:

    vyueyunmsft_1-1705903033332.pngvyueyunmsft_2-1705903134166.png

    item()?['ReportStatus']?['Value']

    if(equals(item()?['ReportStatus'],'Yes' ) ,'green', 'red' )

    item()?['ReportStatus']

    replace(replace(replace(body('Create_HTML_table'),'&lt;','<') ,'&#39;',string('''')) ,'&gt;' , '>')

     

    The result is as follows in teams:

    vyueyunmsft_3-1705903203693.png

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard