In this tutorial, we will learn how to read a table in an Excel file, selectively display specific columns, and then send the resulting data in a nicely formatted HTML table via Outlook. By the end of this post, you will have the ability to extract valuable information from Excel tables and effectively communicate that information to others through clean, professional-looking HTML tables sent via Outlook.

Using Power Automate we can read a table in an Excel file like the one below:

… then select the columns from the table we want to display and then send a nicely formatted HTML table using Outlook:

This is the flow.

If your Excel table contain dates be sure to set the DateTime format to ISO 8601:

If you don’t set DateTime format to ISO 8601 your dates will appear as integer dates:

The Select action is used to select the columns that we want to display in our HTML table.

The output of the Select action is used to create the HTML table.

This is the table formatting style code I used. I have provided the code below which you can copy-and-paste into your flow.

Here is the code that you can copy-and-paste for the Compose Table Formatting Style action:
<style>
table {
border: 1px solid #1C6EA4;
background-color: #EEEEEE;
width: 100%;
text-align: left;
border-collapse: collapse;
table-layout: auto;
}
table td,
table th {
border: 1px solid #AAAAAA;
padding: 10px;
}
table tbody td {
font-size: 13px;
}
table thead {
background: #1C6EA4;
border-bottom: 2px solid #444444;
}
table thead th {
font-size: 15px;
font-weight: bold;
text-align: left;
color: #FFFFFF;
border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
border-left: none;
}
</style>
This is the Send an email action:

Here is a detailed view of the Send an email action. Pay attention to the order of the Compose outputs in the email body or your HTML table styling wont be applied:

This is the email that was sent out:

Notes
Video: Power Automate flow HTML Table Formatting in Email | Flows & SharePoint by @RezaDorrani
Leave a Reply