Dear all,
I have tried before I posted but I'm a bit lost now.
Not sure if I'll be able to explain it well. I have one list called Records where I have columns with names , start date, end date, count of days between dates and it is updated via flow and forms.
Flow based on name from Records updates list called Userdata checks for number in column Used and add (+) with days number then calculated number update in Used (in image is just simple transfer).
I used it this way instead of count totals each time from Records based on name. So my problem starts here.
I did mange this with formulas (image bellow) but there is a problem.
In list Userdata I have Allowed number of days , then I have some days from previous year (leftover), then used (explained earlier), and remaining.
With formulas I managed this: (Allowed + Previous Helper)-Used=remaining beside that there is column Previous which simply sub (-) and shows available days available in Previous for user to see how many are still left.
Previous Helper is for rest of formula to work.
When there is value in Used it is sub from previous and Previous is updated with new value which represents available left.
This is all fine but problem is that in some time I have to clear Previous days but then of course formula starts to sub (-) from Allowed.
Finally what I need is flow to work for me and write numbers into list so it will not be changed when I clear Previous.
1. Based on name from Record get number in column Total and write into Userdata list in column Used .
2. If there is available enough days in Previous then sub from there and write result in Remaining ,
3. Number of days in Used sub with Previous and result write in Previous (to see now how many are left in Previous as we already sub from there).
4. If there are none Available in previous then sub from Allowed (allowed always remain with same number).
5. If there is for example 7 days in Used and only 5 are available in Previous then sub first 5 days from Previous 5 days and two from Previous and set Previous as 0 (zero).

Report
All responses (
Answers (