How to Format a Color-Coded HTML Table in Power Automate
Question details
The user is attempting to generate an HTML email table with conditional colors using data from a Power BI query in a Power Automate flow, but the color coding is not rendering correctly.

- Product
- Power Automate
- Device & OS
- not provided
- Scenario
- Automating an email report where data rows require specific background or text colors based on their values.
- Observed behavior
- The generated HTML table does not display the expected conditional colors based on the output values from the Select action.
Ensure you have access to edit your Power Automate flow and verify that the Power BI query is correctly outputting the specific data values you intend to use for conditional formatting.
Consult the Microsoft Power Automate Community
Since conditional formatting in HTML tables relies heavily on flow-specific configurations and expressions, sharing your flow design with the community is the most effective way to resolve complex logic issues.
Power Automate flows involving Power BI queries, HTML generation, and Select actions can be highly customized. Asking members and engineers in the official community provides you with guidance specific to your flow structure.
Take clear screenshots of your flow design, expanding the Power BI query action, the Select action where formatting occurs, and the Create HTML table step.
Extract a small set of mock data that replicates the issue. Ensure you remove any confidential company data, personal emails, or credentials from this dataset.
Visit the official Microsoft Power Automate Community forums. Create a new topic describing your conditional color logic, attach your screenshots and mock data, and wait for expert community feedback.

Verify Expressions in the Select Action
Often, HTML table colors fail to render because the conditional expression inside the Select action is improperly formatted or the inline CSS is being escaped.
Need an Easier Way to Analyze and Format Data? Try WPS Office
If complex automated data formatting and HTML coding become a bottleneck, WPS Spreadsheet offers a lightweight and highly compatible solution for data analysis, conditional formatting, and reporting without the hassle of writing flow expressions.

Frequently Asked Questions
Why are my HTML tags showing as plain text in the Power Automate email?
This usually happens when Power Automate escapes the HTML tags automatically, or if the email action is not set to accept HTML. You can resolve this by using a Compose action with a replace() function to change escaped characters like < back to <, and ensuring your email action's 'Is HTML' option is set to 'Yes'.
Can I format a Power Automate HTML table without writing CSS?
Out of the box, the 'Create HTML table' action in Power Automate generates a very basic, unformatted table. To add colors, borders, or custom styling, you must inject CSS styling either in a Compose action before sending the email or inline within your Select action.
Is it possible to export Power BI data directly to a formatted Excel file instead of an HTML email?
Yes, Power Automate provides specific actions to export Power BI paginated reports to supported formats like Excel or PDF. This method preserves native table formatting much better than manually constructing HTML tables.




