
Announcements
Hello!
I have a list 'approvals' and a list 'employeeLeaveDaysYearTotal'.
The 'approvals' list are items that are being generated when a user asks for days-off. During his submission, he is asked to pick the dates and also input the total number of days 'daysAsked' (e.g. 3 ) . Everything is working correctly.
The list 'employeeLeaveDaysYearTotal' is a helper list where there are some fields relative to the user's activity about leavedays.
In this list there is a field called 'leaveDaysLeft' or '_x03a5__x03c0__x03cc__x03bb__x03' that i want to update every time the 'ask for leave' is being approved. The ( on-the-fly ) update logic is 'simple'. Get the current 'leaveDaysLeft' (in 'employeeLeaveDaysYearTotal' list), substract the 'daysAsked' (in 'approvals' list) that the user asked and then update the 'leaveDaysLeft' field with the remaining number.
I have it all figured it out except
a) How to update the field 'leaveDaysLeft' where the name is equal to that of the user asking for days-off. In this case i already have it by the USER (UPN) 'Created By DisplayName' from the 'approvals' list.
b) How to implement the ( on-the-fly ) update logic. Should I look for a way to do it in a function or is there another way to do as such.
In my current state, the flow updates all 'leaveDaysLeft' fields for all users with the same value and not just the user who asked for a leave.
Here is a screenshot of my current state:
Thank you for your time!