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

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Frequent Visitor

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.  

Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (5,000)