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?
- Create professional email reports
- Display tabular data clearly
- Improve report readability
- Share business information efficiently
- Automate reporting processes
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:
- Dataverse - List Rows
- SharePoint - Get Items
- Excel - List Rows Present in a Table
- SQL Server - Get Rows
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
- Daily sales reports
- Project status reports
- Approval summaries
- Employee reporting
- Customer activity reports
- Management dashboards
Benefits
- Professional email formatting
- Improved readability
- Automated reporting
- Easy customization
- Better user experience
Key Takeaways
- Create HTML Table action generates tabular data automatically.
- Custom CSS styling improves presentation.
- Formatted tables can be embedded in emails.
- Useful for reporting and business notifications.
- Power Automate simplifies professional report generation.