web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Count occurrences of a...
Power Automate
Unanswered

Count occurrences of a value in an array

(0) ShareShare
ReportReport
Posted on by 26

Hello,

 

I am looking for solutions to counting the number of times a value occurs within an array.

 

I have a SharePoint list that has an award nomination as an item. I've added columns for each committee member (9 members) to select their vote for that nomination. 

 

I want to build a flow that will get the item, store the values of the vote columns in an array and count the number of times a 'Yes' type vote occurs. I want this to loop through until the 'Yes' value appears 3 or more times in the array (send notification to the committee) or a vote of 'Discussion needed' is selected.

 

I have an idea of how to append the values to an array after the get items though I have not built it yet.

 

Has anyone had a similar scenario or ideas on how to accomplish this?

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,690 Moderator on at

    You could use Get Items, filter on Vote eq 'Yes', and then use the Filter Array action for each Nominee; Filter Array - look at the output from Get Items, filter on Employee eq 'Suzy', then length('Filter Array'). 

    Then you can make a condition - if the output of that Length check is equal to 3 or more, then, email the committee. 

    What I'm curious about is - is this all going to happen at once? Or are you re-counting for every vote that comes in? Is this an annual voting kind of thing?

  • cbohlman Profile Picture
    26 on at

    Hi there,

     

    The way I have this set up, is that each nomination is an item on the SharePoint list, and that item has a column for each committee member to assign their vote to that nomination. There are a total of 9 different 'Vote' columns, and any combination of 3 yes's need to trigger the notification of approval.

     

    This actually being added to an existing flow that populates the list with the nomination from a Microsoft Forms. I plan to put the 'Check for Yes's' in a Do Until loop so it can cycle through and check the results of each committee member's vote as they may enter their votes at various times. So this is a repetitive process.

     

    I am not sure I can filter the Get Item by the multiple 'Vote' columns...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard