Using Power Automate for HTML Table Creation

Introduction

We will learn how to use Power Automate to create an HTML table in this article.

Step 1. To manually start the flow, log in to Power Automate, select Create, and then choose an instant cloud flow.

Cloud Flow

Step 2. After choosing the List rows action and configuring the Dynamic CRM Instance and List name, click the Next step. This will retrieve every item from the Dynamic CRM list that you have chosen.

Trigger Flow

Step 3. To map the key-value pair using the "Select" data operation, click the next step now. Next, include the value from the dynamic content in the "From box." Next, by adding the key-value pair to the Map box, we will map values dynamically.

We will create something like this based on the names of the Dynamic CRM Account list columns. In the key text box, type the key name. Next, add the dynamic content value in the value box, as shown below.

Value

Step 4. By choosing the "Create HTML table" action from the action triggers, we will now create an HTML table in the following step.

Next, for the select data operation action, choose the "output" from the dynamic content in the From box. Then, in the Columns box, choose Automatic.

Create HTML Table

Step 5. To apply the style for the generated HTML table, we will now add a compose action. To do this, add the CSS code below.

<style>
table {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table tbody td {
  font-size: 13px;
}
table thead {
  background: #1C6EA4;
  border-bottom: 2px solid #444444;
}
table thead th {
  font-size: 15px;
  font-weight: bold;
  color: #FFFFFF;
  border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
  border-left: none;
}
</style>

Table

Step 6. Choose the Send an Email (V2) (outlook) action to send an email. Pass the dynamic content user's email address in the To address field.

Next, include the style-composed action's outputs and the HTML action from the dynamic content in the body.

Table Style

Step 7. By choosing the run flow option, you can save and manually test the flow.

Test Flow

Table created successfully

Summary

In this article, I discussed how we can create an HTML Table using Power Automate flow.  We also saw how we can format a Table by setting its border, background, and foreground properties.


Similar Articles