Power Automate create an HTML table

In this Power Automate tutorial, we will see how to create an Html table using Power automate or Microsoft flow.

So, here we will create a Microsoft flow, which will send the monthly projects report to the Project Manager via Outlook Email and Microsoft teams.

Power Automate Create an HTML Table from SharePoint List

Here we will see how to create Html table from SharePoint list using Power Automate.

So here I have a SharePoint list called Project Management. When a manager assigned a project/task to the team member. At the end of the month when the manager asks for project status.

If he/ she wants to get the monthly status by auto-emailed or Microsoft teams, then Microsoft Flow ‘Create HTMl table‘ is the best choice to send the status via Outlook email and Microsoft Teams.

Create an Html table from SharePoint List using Power Automate – Steps

Steps 1: Create a SharePoint List

I have already created the Project Management list in SharePoint Online, which had the 6 columns with the required column type.

Column NameColumn Type
TitleSingle Line of text
Assigned toPerson
Start DateDate and Time
End DateDate and Time
StatusChoice
BudgetCurrency
CommentMulti-line of text
Project Mangement List in SharePoint Online
Power Automate Create an HTML Table from SharePoint List
Power Automate Create an HTML Table from SharePoint List

Once your SharePoint Project Management list is created, we will move towards creating a flow using Power Automate.

Step 2: Create a flow in Power Automate

Now we will create a flow, which will trigger on the monthly basis to send the status via email and Microsoft Teams.

  • Log in to the Power Automate, then click on the Create icon from the navigation bar, and then select Scheduled Cloud Flow.
Power Automate create an HTML table
Power Automate create an HTML table

Now Provide the flow name, then to run the flow give the date and time, so in our case, we will provide a report on a monthly basis so we will choose the month. So flow will trigger every month at a given date and time. Then click on Create.

Power Automate Create an HTML Table
Power Automate Create an HTML Table

Step 3: Get items From SharePoint list

Now In this step click on the Next step and then select Get items(Sharepoint) provide the Site address and List name, then we will filter the items.

So we will filter the Project based on the status is completed and In progress and based on the current month.

For this write the below query in the Filter Query section:

Status eq 'In Progress' or Status eq 'Completed'
and StartDate ge addDays(utcnow('yyyy-MM-ddTHH:mm:ssZ'),-30) and StartDate lt utcNow('yyyy-MM-ddTHH:mm:ssZ') 
Power Automate create an HTML table format
Power Automate create an HTML table format

Step 4: Map column to key-value pair using Select

Now click on the next step, then select the ‘Select‘ data operation. Then in the ‘From box’ add the value from dynamic content.

Next, we will do the dynamic mapping by adding the key-value pair in the Map box.

So in the key box give the meaningful name corresponding to the column and then in the value box add the dynamic content, like below:

Power Automate create an HTML table format
Power Automate create an HTML table format

Step 5: Create an Html table

Now in this step, we will create an Html table, for this click on the next step, then select ‘Create HTML table‘.

Next in the From box, select the ‘output’ from the dynamic content, and in the Columns box select Automatic.

Power Automate create an HTML table from json
Power Automate create an HTML table from json

Step 6: Format the Html Table

Now we will format the HTML table by adding CSS code in the compose action.

To add CSS code we will use the Compose action, so click on the next step then select the Compose (Data operation).

In the Input box add the below expression:


replace(body('Create_HTML_table'),'<table>','<table border="3">')
Power Automate create an HTML table custom columns
Power Automate create an HTML table custom columns

Once your Html table is ready we will send an email in outlook and Teams notification.

Step 7: Send an email via outlook

To send an email, click on the next step then select Send an Email (V2) (outlook) action.

Now provide the email of the manager in ‘To’, then provide the Subject and then in the body add outputs of the compose action from dynamic content.

Power Automate Create an HTML Table from SharePoint List
Power Automate Create an HTML Table from SharePoint List

Step 8: Post on Teams

To Post the Project monthly report on Teams, click on the next step, then select the “Post message in a chart or channel” action.

Next, provide post as, post in, Team, Channel, subject and in Message add the outputs of the compose action from the dynamic content.

How can we create HTML table in power automate?
How can we create HTML table in power automate?

Once your flow is ready, click on the Save icon, then run the flow manually for testing purposes.

Step 9: Run the Flow

As we have set the flow to trigger on a monthly basis with the assigned date and time, at that date and time flow will start triggering.

Before that, if we want to test the flow, click on the test icon, then select manually -> click on done and then Run the flow.

Once your Flow ran successfully, you can check your outlook email and Microsoft Teams.

create an html table flow
create an html table flow

It will send the Project Report of the current month and also if the status of the Project should be completed or inprogress in Html table.

Power Automate Create an HTML Table from SharePoint List
Power Automate Create an HTML Table from SharePoint List

And also it will send a project report in HTML table to the Microsoft Teams.

Power Automate create an HTML table format
Power Automate create an HTML table format

In this Power automate tutorial we learned how to create an Html table from SharePoint list using Power Automate.

Related Power Automate tutorials:

>