How to Create HTML Table in Power Automate?

Are you interested to know how to create HTML table in Power Automate? Yes, then you are at the right place.

I will show you how to create an HTML table using Power Automate HTML expression in this Power Automate tutorial. Also, I will show how to create an HTML table with Border in Power Automate.

Moreover, we will discuss how to create a Power Automate HTML table from a SharePoint List.

How to Create HTML Table in Power Automate

Here, I will show how to create an HTML table in Power Automate using the HTML expression.

To achieve this, follow the steps below.

1. Open Power Automate using https://make.powerautomate.com in your browser -> Click on + Create -> Select the Instant cloud flow -> Provide the flow name and choose the trigger’s flow (Manually trigger the flow).

2. Next, add the ‘Compose’ flow action to provide an HTML expression to get the desired columns in the HTML table.

concat('<table border="1"><tr><th>Employees Name</th><th>Employees Age</th><th>Employees Department</th><th>Employee Joining Date</th></tr>',
    '<tr><td>John</td><td>30</td><td>IT</td><td>2023-01-15</td></tr>',
    '<tr><td>Alice</td><td>28</td><td>Marketing</td><td>2023-01-20</td></tr>',
    '<tr><td>Bob</td><td>35</td><td>Finance</td><td>2023-02-05</td></tr>',
    '<tr><td>Charlie</td><td>32</td><td>HR</td><td>2023-03-10</td></tr>',
    '<tr><td>Diana</td><td>27</td><td>Development</td><td>2023-04-15</td></tr>',
    '<tr><td>Eva</td><td>31</td><td>Testing</td><td>2023-05-20</td></tr>',
'</table>')
  • Concat = The Concat function is used to concatenate multiple strings together.
  • Employees Name, Employees Age, etc. = contains headers for the columns: “Employees Name,” “Employees Age,” “Employees Department,” and “Employee Joining Date.”
  • Subsequent rows = represent individual records. Each row includes data for “Name,” “Age,” “Department,” and “Joining Date.
  • Closing Tags= ‘</table>’): This marks the end of the HTML table.
Power Automate Create HTML Table

3. Add the ‘Send an email (V2)’ flow and set all the required details:

  • To: Provide the email address of the user whom you want to send.
  • Subject: Enter the purpose of the email.
  • Body: Here, I have given the output of the Compose action.
Create HTML table in Power Automate

4. Now, click Save and Test -> Then test it Manually -> Inside the Run flow tab, click on Run flow. Then, open the inbox in your Outlook, displaying the output according to the HTML expression.

How to create HTML table in Power Automate

This is how we can create an HTML table in Power Automate.

How to Create HTML Table with Border in Power Automate

Let’s create an HTML table with Border in Power Automate. For this, I have used an HTML code to implement this.

To achieve this, follow the steps below.

1. Navigate to https://make.powerautomate.com in your browser to open the Power Automate home page; click on + Create -> Select the Instant cloud flow -> Provide the flow name and choose the trigger’s flow (Manually trigger the flow).

2. Next, add the ‘Compose’ flow action to set the expression to provide the borders to the HTML table.

<table style="border-collapse: collapse; width: 100%; border: 2px solid #4CAF50; margin: 20px;">
    <thead>
        <tr style="background-color: #4CAF50; color: white;">
            <th style="border: 2px solid #4CAF50; padding: 12px;">Name</th>
            <th style="border: 2px solid #4CAF50; padding: 12px;">Age</th>
            <th style="border: 2px solid #4CAF50; padding: 12px;">Department</th>
        </tr>
    </thead>
    <tbody>
        <tr style="background-color: #f2f2f2;">
            <td style="border: 2px solid #4CAF50; padding: 12px;">John</td>
            <td style="border: 2px solid #4CAF50; padding: 12px;">30</td>
            <td style="border: 2px solid #4CAF50; padding: 12px;">IT</td>
        </tr>
        <tr>
            <td style="border: 2px solid #4CAF50; padding: 12px;">Alice</td>
            <td style="border: 2px solid #4CAF50; padding: 12px;">28</td>
            <td style="border: 2px solid #4CAF50; padding: 12px;">Marketing</td>
        </tr>
    </tbody>
</table>
  • <table> = Defines the start of the HTML table.
    style= Sets the table styles, including collapsing borders, full width, a green border, and a margin of 20px.
  • <thread>= Represents the table header section.
    <tr style= Styles the header row with a green background and white text.
    Name= Defines a header cell with a green border, padding of 12px, and the text “Name”. Similar cells for “Age” and “Department.”
  • <tbody>= Represents the table body section.
  • <tr style= Styles the first data row with a light gray background.
  • <td style= Defines a data cell with a green border, padding of 12px, and the text “John.” Similar cells for “30” and “IT.”
  • A similar structure for the second data row with alternating background color.

3. Then add the ‘Send an email(V2)’ flow action to send an email consisting of the HTML table with borders. Set all the details.

  • To: Provide the user email to whom you want to send email.
  • Subject: Enter the purpose of that email.
  • Body: I have given the Outputs of the Compose flow action here.
How to Create HTML Table with Border in Power Automate

4. Now, it’s time to Save and Test. Then, test it Manually. Then, the Send an email(V2) flow action will display the output below.

Create HTML Table with Border in Power Automate

This is how we can create an HTML table with Border in Power Automate.

Power Automate Create HTML Table From SharePoint List

Let’s see how to Power Automate create HTML table from a SharePoint list.

I have taken a SharePoint list named ‘Employees Data‘ with different columns and data types for this.

Columns Data Types
Employee IDSingle line of text
Employee NameSingle line of text
Employee Email IDMultiple lines of text
Employee DOBDate and Time
Power Automate create HTML table from SharePoint list

To work around this, follow the steps below.

1. Navigate to https://make.powerautomate.com in your browser to open the Power Automate home page -> Click on + Create -> Select the Automated cloud flow -> Provide the flow name and choose the trigger’s flow (When an item is created and modified).

  • Provide the Site Address and List Name for this trigger.
Create HTML table in Power Automate from SharePoint

2. Add the ‘Get items’ flow action to retrieve all information from a SharePoint list and set the required fields.

  • In this action, provide the Site Address and List Name.
How to create HTML table in Power Automate from SharePoint

3. Next, add the ‘Create HTML table’ flow action for formatting and presenting data in a structured manner and set the required fields.

  • From: Here, I have selected the value of the Get items’ output from dynamic content.
  • Then, add the custom table value manually, as shown below.
HeaderValue
Employee Name
Employee Email ID
Employee DOB
Select value from the dynamic content under Get items and expression
How Power Automate create HTML table from SharePoint

4. Now, it’s time to Save and Test. Test it Manually -> Then the Create HTML table will display the output according to the custom value entered.

Power Automate create HTML table using SharePoint list

This is how Power Automate create HTML table from the SharePoint list.

Conclusion

I hope this Power Automate tutorial taught you how Power Automate create HTML table. Like:

  • Power Automate create HTML table from HTML expression
  • Create an HTML table with Border in Power Automate
  • How to create a Power Automate HTML table from SharePoint List

Also, you may like some more Power Automate tutorials: