Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

can we format html using javascript in power automate

Hi All,


I have written a flow to send mail.

I have created HTML Table and I want the background color  to change based on the content of the cell.


If value=Red -> background color should be Red

If value=Green ->background color should be Green 

I have written java script for this using compose action


But this is not reflected in mails.


Your help on this will be highly appreciated


Thanks in advance


Hi @Suma27 


You cannot use javascript for styling in email actions. You can use the style tags though. You can check out this post for more on styling a table for email in Power Automate: 


Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Regular Visitor

Do we know if Microsoft intends to enable javascript within the HTML of Send Email?  I'm in the same boat as @Suma27 .  The only workaround I can think of is having a

IF value=Red -> background color should be Red" => run this workflow. 

IF value=Green ->background color should be Green  => run that workflow. 

This makes for a very ugly Flow!!


Any thoughts or suggestions?


Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,748)