A table structure always ensures that information is presented in a clear and easily digestible format, making it quick for customers to understand when included in an email. Tables help organize data efficiently, improving readability and professionalism.
By utilizing the HTML Table action in Power Automate, developers can effortlessly design and align tables without requiring extensive coding or formatting adjustments. This feature simplifies the process of structuring data, saving time and effort.
In this blog, we will explore how to effectively send data in a tabular format via email, ensuring clarity and a polished presentation.
My data looks like this
Name : Anitha Eswaran
Domain : Microsoft Dynamics 365FO
Years of Exp : 19 years
Current Residence : United Kingdom
Primary Role : FO Technical Architect
Other Skills: Logic apps & Power Automate
The flow starts with declaring the above data in a variable.
In order to bring this in a tabular format, we need to split the variable by identifying the :
split(variables('inputVariable'), decodeUriComponent('%0A'))
Declare a new array variable ‘readSplit’ for capturing the Key-Value and using a loop , read the contents from the SplitVariable array .
trim(first(split(item(), ':')))
trim(replace(item(), concat(first(split(item(), ':')), ':'), ''))
The first expression is easy to understand. I am giving the explanation for the second expression to arrive at the Value Pair
This expression extracts the value from a key-value pair formatted as "key:value"
, removing the key and the colon while trimming extra spaces.
split(item(), ':')
Splits the string in item() by the colon (:) delimiter.
This results in an array where the first element is before the : and the remaining elements are after.
first(split(item(), ':'))
Extracts the first element from the split array, which is everything before the first :
concat(first(split(item(), ':')), ':')
Concatenates the first split element with a colon (:), reconstructing the key portion of a key-value pair.
replace(item(), concat(first(split(item(), ':')), ':'), '')
Replaces the key (with the :) in the original string with an empty string (''), removing it and leaving only the value.
Now the variable ‘readSplit’ has accumulated the Key-Value data, using HTML table connector, the variable is assigned.
In order to style the HTML table, add the below CSS snippet in a compose .
<style>
Table {
font-family: Arial, Helvetica, sans-serif;
background-color: #EEEEEE;
border-collapse: collapse;
width: 100%;
}
Table td, Table th {
border: 1px solid #ddd;
padding: 3px 3px;
}
Table th {
font-size: 15px;
font-weight: bold;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #1C6EA4;
color: white;
}
</style>
Final step is the email connector adding the variables of compose and HTML output
Test the flow and user will be able to see an email having data in tabular format.
Original Post https://anithasantosh.wordpress.com/2025/02/21/tabular-format-html-table-in-power-automate/