I have a Sharepoint list as follows
Project Name | Component | Status | Created By |
Test-1 | C-1 | Open | Bijumon |
Test-1 | C-2 | Pending | Bijumon |
Test-1 | C-3 | Completed | Bijumon |
Test-2 | C-1 | Open | Bijumon |
Test-2 | C-2 | Completed | Bijumon |
Test-3 | C-1 | Open | Aarav |
Test-3 | C-2 | Completed | Aarav |
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 Name | Status_Count_Open | Status_Count_Pending | Status_Count_Completed |
Test-1 | 1 | 1 | 1 |
Test-2 | 1 | 0 | 1 |
2. Mail to aarav
Project Name | Status_Count_Open | Status_Count_Pending | Status_Count_Completed |
Test-3 | 1 | 0 | 1 |
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 ) ]
Solved! Go to Solution.
@bijoumon below steps can help you get started:
1. Add and configure Get Items action to the flow to get data from SharePoint list
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
In compose action use below expression
union(body('SelectCreatedBy'),body('SelectCreatedBy'))
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
3. Add Create HTML Table action, use Body of Filter Array action dynamic content in the From paramater
4. Now you can send email using this HTML table in email body content.
@bijoumon below steps can help you get started:
1. Add and configure Get Items action to the flow to get data from SharePoint list
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
In compose action use below expression
union(body('SelectCreatedBy'),body('SelectCreatedBy'))
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
3. Add Create HTML Table action, use Body of Filter Array action dynamic content in the From paramater
4. Now you can send email using this HTML table in email body content.
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.
Thank You..
Yes I am working as you stated, ... will revert you on result...
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
User | Count |
---|---|
16 | |
16 | |
14 | |
9 | |
8 |
User | Count |
---|---|
27 | |
26 | |
24 | |
23 | |
14 |