Create HTML table Power Automate Action
Create HTML table Power Automate Action

Background

I wanted to share with you a use case where I needed to build a HTML table utilizing Power Automate. This simple process involves taking an array of data, and the using Power Automate to add it to a HTML table to then use. This could be either posted somewhere or added to an email.

In my case, I had a client who needed a list of IT assets signed out to a contractor. When the contract ended, the assets manager needed a list of those items so that he could arrange for their retrieval.

What I need

Simply, I need the data I require to add to the HTML table, I also need a way to create the HTML table in Power Automate. The solution I was developing used a Model Driven Power App & Dataverse. I needed to get all assets signed out to the contractor from the Dataverse assets table and into Power Automate.

In order to do this, I need the User ID of the contractor, in my example, this is provided by a Parent Flow, you can easily build this into other triggers depending on your business case.

Get the data!

I then have the List Rows action and a Fetch XML Query to gather all rows where the assets are ‘owned’ by the contractor.

Use the data!

Now that I had all assets needed from the Dataverse table in my Power Automate flow, i needed a way to transform that data into the HTML table.

The next simple step is to use the ‘Create HTML table’ action in Power Automate. This action gives you an easy automated option for the columns you want to use from your data. I only wanted some of the columns, so I chose the custom option.

Screen shot of Power Automate Create HTML table action

Send the data!

Now that we have the data organized in a way you are happy with, we can use the HTML table output to better effect. for my solution, I need to send an email to the asset manager. As simple as can be, I set a new action of ‘Send an email (V2)’ and within the body of the email, you can add the output from the ‘Create HTML table’.

Power Automate step to send an email action with HTML table.

The Result

As you can see by the email, I now have (albeit a very basic) HTML table of the assets I wanted to recover from the contractor.

What Next?

Now that we are able to get the HTML table, we can develop this further with CSS and customization of the HTML. I will cover this in another post. Hopefully this quick intro to creating HTML tables will be enough to give you the confidence to try it yourself and succeed! If not, please drop a comment or let me know what I can do to help you further!

Leave a Reply

Your email address will not be published. Required fields are marked *