Friday, May 28, 2021

Create HTML Table and Bind the array data in Power automate

 In this post , we are going to see how to bind the array data into html table and send the mail.


Follow the below step to achieve this.


1. Create Array variable before foreach action

2. Bind the array value inside the foreach action

3. Add Create HTML table after foreach action

4. Add Style compose to style html type

5. Add compose to remove a href tag if column has hyperlink

6. Add style output first in outlook email send

7. Add Replace a href output as second in email


Case ID array object has link ->outputs('Case_ID_Link');


Style:


<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: 12px;

  font-weight: bold;

  padding-top: 10px;

  padding-bottom: 10px;

  text-align: left;

  background-color: #1C6EA4;

  color: white;

}

</style>


Replace a href tag:

replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>')




1. 

2. 


3. 




output: