Hi all, I am trying to create a leave workflow that copies number of days of annual leaves taken to another list (lets call it Leave Balance), it also must subtract the number of days taken from 30 (which is eligible days). I have already done this and it works fine. The thing is if a user applies more than one time for a leave, the first time number of days should be subtracted from 30, otherwise it should subtract from remaining eligible days.
I think that I should be using run if action, then update field but I am not sure about the configuration.
Any help would be appreciated.
Please note that this process is in leave request workflow so upon approving, line manager must refer to leave balance list to check number of days left for employees.
use query list action to get latest record.
configure the action to sort by a column that identifies sequence in which single requests were recorded or approved.in descending order
configure the action to return just 1 item
if the query doesn't return any result, you know there is not any item recorded yet and so you should substract from 30.
if it returns a result you have actual balance you have to substract from.
but do you realy need to store actual balance in list? wouldn't it be easier to store just number of spent (approved) days and calculate balance in form?
see a possible example
what's the error?
what action does it fail on?
what's single actions configuration?
what are input values to the failing actions? - write them to log
we need more details what's your exact problem, we do not have magic crystal ball 🙂