cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bijoumon
Frequent Visitor

HTML Table creation for Status Count in PowerAutomate

I have a Sharepoint list as follows

 

Project Name  ComponentStatusCreated By
Test-1C-1OpenBijumon
Test-1C-2PendingBijumon
Test-1C-3CompletedBijumon
Test-2C-1OpenBijumon
Test-2C-2CompletedBijumon
Test-3C-1OpenAarav
Test-3C-2CompletedAarav

         

I'd like to get an HTML Table out put from PowerAutomate as follows and a mail should be sent to the respective Created By:

1.     Mail to bijumon

Project NameStatus_Count_OpenStatus_Count_PendingStatus_Count_Completed
Test-1111
Test-2101

2.     Mail to aarav

Project NameStatus_Count_OpenStatus_Count_PendingStatus_Count_Completed
Test-3101

 

Can anyone give some input how to achieve this.

 

Current status of the flow is as follows:

[

Now for each Project Name individual mail is triggered as it is running inside an Apply to Each. I couldn't make a consolidated table based on Created by ( ex: for above table, now two mail with HTML table is sent to bijumon )

 

This will be weekly reminder mail (recurrence ) ]

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
annajhaveri
Community Champion
Community Champion

@bijoumon  below steps can help you get started:

 

1. Add and configure Get Items action to the flow to get data from SharePoint list

annajhaveri_0-1662121465384.png

 

2. Add Select and compose action as shown below to get unique values from createdby column

 

Here select output of Get Items - value (list of items) and select Created By Email as it will be unique for each user. Rename the action as SelectCreatedBy

annajhaveri_1-1662121478868.png

In compose action use below expression

union(body('SelectCreatedBy'),body('SelectCreatedBy'))

annajhaveri_2-1662121520862.png

 

3. Loop through values of output of compose action using Apply to each action, the output of compose action is array of unique CreatedBy values

In the apply to each action

1. Add Compose action to get current created by email, using below expression

items('Apply_to_each_4')['CreatedBy']

2. Add Filter Array action, in the From parameter use Value (list of items) from Get Items, compare the outputs of compose action and Created by email

annajhaveri_3-1662121630669.png

3. Add Create HTML Table action, use Body of Filter Array action dynamic content in the From paramater

 

annajhaveri_4-1662122409143.png

4. Now you can send email using this HTML table in email body content.

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
annajhaveri
Community Champion
Community Champion

@bijoumon  below steps can help you get started:

 

1. Add and configure Get Items action to the flow to get data from SharePoint list

annajhaveri_0-1662121465384.png

 

2. Add Select and compose action as shown below to get unique values from createdby column

 

Here select output of Get Items - value (list of items) and select Created By Email as it will be unique for each user. Rename the action as SelectCreatedBy

annajhaveri_1-1662121478868.png

In compose action use below expression

union(body('SelectCreatedBy'),body('SelectCreatedBy'))

annajhaveri_2-1662121520862.png

 

3. Loop through values of output of compose action using Apply to each action, the output of compose action is array of unique CreatedBy values

In the apply to each action

1. Add Compose action to get current created by email, using below expression

items('Apply_to_each_4')['CreatedBy']

2. Add Filter Array action, in the From parameter use Value (list of items) from Get Items, compare the outputs of compose action and Created by email

annajhaveri_3-1662121630669.png

3. Add Create HTML Table action, use Body of Filter Array action dynamic content in the From paramater

 

annajhaveri_4-1662122409143.png

4. Now you can send email using this HTML table in email body content.

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thank You for the input..

 

But this won't solve my scenario. This will pick all my data related to the created mail.

 

There will be duplications.

 

I would like to get a consolidated Count report of Status like 'Open' how many for particular Project Name.

 

I have given a desired output table above in my post.

@bijoumon  as i mentioned this is a starting point. Not a complete solution to your requirements. You can apply more filters to the Filter array action to get items where status is Open and project name is a specific project name. Add another filter array action to get items where status is Closed. And you can use HTML to build the table for report, you can refer to below post on how to build HTML table and also how to get length of records returned by filter array.

 

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Get-Unique-Values-from-SharePoint-...

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thank You..

Yes I am working as you stated, ... will revert you on result...

bijoumon
Frequent Visitor

@annajhaveri 

Thank You for the initial input.

I have achieved this as required.

Took Project code and created by into a selection and made them unique.

with that went for an apply to each and took status details separately by filtering the the get content based on Project Code and Status.

Then created an excel with table and put all details with count into that.

In that excel,  applied the filter as you directed and created HTML table as shown as requirement in my post.

Also able to avoid duplication in send email  ( duplication happened because of apply to each loop earlier ).

 

@bijoumon  thanks for update, if any response helped you please mark it as answer to help other looking for similar problem

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,659)