cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bhryszkanich
Level: Powered On

Counting Get Items Duplicates For A Value

Hi,

 

I have a flow that reads a simple SharePoint list which contains a column called CoveredBy.  This column will have the name of the person who covered a shift.  There will be many duplicate items for the same name.  I want to create a flow which will output a table with each unique name and how many times they have covered a shift (so basically a list of the unique names and how many times they reappear so if the name Bob appeared in 5 items and John appeared twice it would output Bob 5 John 2). 

I have no idea where to even start with this one.  Anyone have any ideas? 

 

Please let me know if I didn't explain this clearly.  

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Counting Get Items Duplicates For A Value

Hi @bhryszkanich ,

 

Could you tell us the field type of CoveredBy?

The difference in type will affect the configuration of Flow. I would illustrate this type of approach with Single line of text.

 

  • Initialize two array variables, the first one to store all the person names contained in the list, and the other to store the fields that the table needs to display.8.PNG

 

  • Configure the first Get items to get all the person names and append them to Person variable.9.PNG

 

  • Use union() function to remove the duplicate person name and then iterate through the array.
  • Configure the second Get items, and use Filter Query to filter out the same items as the person name that was traversed.
  • Use length() function to calculate the number of items obtained by Get items 2, and append the person name and number to the table.10.PNG

 

  • Finally configure HTML table action.11.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Counting Get Items Duplicates For A Value

Hi @bhryszkanich ,

 

Could you tell us the field type of CoveredBy?

The difference in type will affect the configuration of Flow. I would illustrate this type of approach with Single line of text.

 

  • Initialize two array variables, the first one to store all the person names contained in the list, and the other to store the fields that the table needs to display.8.PNG

 

  • Configure the first Get items to get all the person names and append them to Person variable.9.PNG

 

  • Use union() function to remove the duplicate person name and then iterate through the array.
  • Configure the second Get items, and use Filter Query to filter out the same items as the person name that was traversed.
  • Use length() function to calculate the number of items obtained by Get items 2, and append the person name and number to the table.10.PNG

 

  • Finally configure HTML table action.11.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

bhryszkanich
Level: Powered On

Re: Counting Get Items Duplicates For A Value

Sorry for the delayed reply, I was out of the office.  Thank you very much!  I will try this today.

 

The column was a lookup, but I changed it to a single line of text since you already gave that answer.  

Community Support Team
Community Support Team

Re: Counting Get Items Duplicates For A Value

Hi @bhryszkanich ,

 

Any update?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bhryszkanich
Level: Powered On

Re: Counting Get Items Duplicates For A Value

Thank you very much, this worked for me.  I have some changes to make, but I am far enough to know that this is an acceptable solution and I will mark it as such.  

 

I really appreciate the assistance.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,261)