Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

flow to count list elements on Sharepoint



I have posted this here before, but the suggestion I got for a solution doesn't work. I thought I would be able to find a solution using that as a template, but I failed.... Here's the problem:


I have been asked to create a Flow which can do more or less this:


I have two lists; "Total" and "In use".. The first list has two elements titled "squares" and "circles", and it has a column called "quantity". 


The second list tells us who has the squares and circles. So, a list element there may be; "Title: Square; User: John; Quantity: 3; Status: In use". The second list also lists the number of circles we have purchased ("Title; Square; User; 'empty'; Quantity: 40; Status: Purchased"). 


I want to create a flow which once per day counts how many squares and circles we have in stock and edits the quantity column on the first list accordingly. So, it adds all the purchased items and subtracts all the ones in use. 


There are, of course, alternative approaches to managing items. However, I cannot see how to create a flow which runs through an entire list neither do I see a way to do something akin to "circles = circles + total" for other approaches to the problem (like having a Flow edit the first list whenever the second list gets a new element). 

Community Support
Community Support

Re: flow to count list elements on Sharepoint

Hi @nohus,


Do you want to update the Total list with how many squares and circles in stock?

I have made the following flow, please check it for a reference. In my scenario, I am just going to update the quantity of circles, you could add a parallel branch to update the quantity of squares.

According to your description, create two lists Total and In use with required columns.

Initialize circles variables of type Integer, get items from In use list, add filter query action to filter out circles, then increment variables to get the total quantity of circles.

Than get items from list Total, filter out all the circles, and update the corresponding quantity with the output of Compose action.

Screenshots for your reference.


Please also check the following blog for a reference:


Best regards,


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

Helpful resources

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 (7,374)