Hi
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).
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:
https://flow.microsoft.com/en-us/blog/calculate-running-totals-and-tracking-maximum-values-in-flow/
Best regards,
Mabel
User | Count |
---|---|
93 | |
44 | |
21 | |
17 | |
16 |
User | Count |
---|---|
137 | |
50 | |
42 | |
39 | |
29 |