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 Name | Column Type |
---|---|
Title | Single Line of text |
Assigned to | Person |
Start Date | Date and Time |
End Date | Date and Time |
Status | Choice |
Budget | Currency |
Comment | Multi-line of text |
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.
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.
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')
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:
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.
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">')
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.
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.
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.
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.
And also it will send a project report in HTML table to the Microsoft Teams.
In this Power automate tutorial we learned how to create an Html table from SharePoint list using Power Automate.
Related Power Automate tutorials:
- Trigger Conditions in Power Automate
- Power Automate Switch Case Multiple Conditions
- Power Automate update SharePoint list item
- Unable to process template language expressions in action Power Automate
- Move files from OneDrive for Business to SharePoint Online
- Power Automate Forms to Excel
- Power Automate Get Data from Excel on SharePoint
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.
replace(body(‘Create_HTML_table’),”,”)
The expression is invalid.
if we have mulitple Sharepoint list need report send to email , how can create flow ?