Create and Format HTML Table Using Microsoft Flow (Power Automate)

Create and Format HTML Table Using Microsoft Flow (Power Automate)

Power Automate provides a simple way to generate HTML tables from dynamic data and use them in emails, approval notifications, dashboards, and automated reports. HTML tables make data easier to read and present in a professional format.

In this article, we'll learn how to create an HTML table and apply custom formatting to improve readability and appearance.

Why Use HTML Tables?

Scenario

Suppose you retrieve employee, sales, project, or customer records from Dataverse, SharePoint, or Excel and want to send them in a formatted email.

Step 1: Retrieve Data

Retrieve records using any connector such as:

Step 2: Create HTML Table

Add the Create HTML Table action.

Action:

Create HTML Table

From:

value

Select Automatic or Custom columns depending on your requirements.

Step 3: Apply Custom HTML Formatting

Use a Compose action to add custom styling.

<style>
table {
border-collapse: collapse;
width:100%;
}

th {
background-color:#0078D4;
color:white;
padding:10px;
}

td {
padding:8px;
border:1px solid #ddd;
}
</style>

Step 4: Combine Style and Table

Use the following expression inside a Compose action:

concat(
outputs('Compose_Style'),
outputs('Create_HTML_Table')
)

Step 5: Send Email

Add the Send an Email (V2) action and place the formatted HTML content inside the email body.

Body:

outputs('Formatted_HTML_Table')
Important: Enable HTML formatting in the email body to ensure the table renders correctly in Outlook and other email clients.

Sample Output

Employee Department Status
John Sales Active

Common Use Cases

Benefits

Key Takeaways