cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jojo222813
Helper I
Helper I

Groupby and Count

Hi, I am new to Power Automate.

I have 2 sharepoint list. I want to create a flow that will go through the List1 and count the complete status of each email. There is another list called List2. If email is not in that list it creates the entry if it is there then just update the count. So in that list i have email and the count of status = "Completed". 

I know that sharepoint list can filter by status and groupby the email. However, I need to export those information for user, that's why I need another sharepoint list to store those data.

 

List1

IDTitle (Email)DateStatus
1abc@email.com17/2/2022Completed
2abc@email.com3/3/2022Completed
3abc@email.com28/3/2022Scheduled
4def@email.com1/3/2022Completed
5ghi@email.com1/4/2022Scheduled
6jkl@email.com3/3/2022Completed

 

List2

IDTitle (Email)CountStatus
1abc@email.com2
2def@email.com1
3ghi@email.com0
4jkl@email.com1
7 REPLIES 7
v-qiaqi-msft
Community Support
Community Support

Hi @Jojo222813,

Do you want to update the list2 based on the items created in list1?

Could you please share a bit more about your scenario?

 

Here is a flow I will configure to achieve your need.

vqiaqimsft_0-1648802920572.png

1). You should initialize a variable to store the count number

vqiaqimsft_1-1648803022211.png

2). Apply to each record for those returned from Get items:

Note that the first Title is from the trigger and the second Title is from the Get items

vqiaqimsft_2-1648803235093.png

3). Update the item in list 2:

vqiaqimsft_3-1648803323464.png

Here is the test result:

vqiaqimsft_4-1648803349923.pngvqiaqimsft_5-1648803358353.png

 

 

Best Regards,
Qi

@v-qiaqi-msft  Yes, I want to update list 2  based on the items created or update in list1. 

My scenario is when I update or create an item in list 1, then trigger a flow to update list 2 count (the status eq 'Completed'). 

Since list 1 already has some data, I am not sure how to achieve the first update in list 2.

May I know is your solution will update the count of each 'Title' everytime?

Hi @v-qiaqi-msft ,

 

I tried to follow your solution, please i cannot get the correct result. Every record CountStatus = 3. 

Jojo222813_2-1649039723186.png

 

The countstatus should be as below:

 TitleCountStatus
1admin@M365x56770927.onmicrosoft.com3
2AlexW@M365x56770927.OnMicrosoft.com3
3IrvinS@M365x56770927.OnMicrosoft.com1
4MeganB@M365x56770927.OnMicrosoft.com2

 

 

 

Hi @Jojo222813,

Could you please show me you flow configure?

I have provided the screenshot of my flow configure which works great, please check it one more time.

Best Regards,
Qi

Hi @v-qiaqi-msft ,

 

Please let me know if you need more information.

Jojo222813_3-1649053672789.png

 

Jojo222813_4-1649053699822.pngJojo222813_5-1649053720331.png

 

Jojo222813_1-1649053393010.png

Jojo222813_2-1649053615317.png

 

 

Hi @Jojo222813

That's weird. 

I have test it again on my side and the flow runs great.

Could you please check the variable settings?

Best Regards,
Qi

Hi @v-qiaqi-msft 

 

Please find the variable setting below:

Jojo222813_0-1649208129497.png

 

Jojo222813_1-1649208150036.png

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,146)