FatmaQ
Canvas Initiate

run if action and save in another list

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.

0 Kudos
Reply
3 Replies
emha
Automation Master
Automation Master

Re: run if action and save in another list

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 

https://community.nintex.com/t5/Nintex-for-SharePoint/Lookup-several-values-out-of-a-list-and-displa... 

0 Kudos
Reply
FatmaQ
Canvas Initiate

Re: run if action and save in another list

The balance left is stored in the form not the actual balance. Calculations are done through workflow.

The left side of the workflow produces error, and item is not updated.

Capture1.PNG

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: run if action and save in another list

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

...etc.

 

we need more details what's your exact problem, we do not have magic crystal ball 🙂 

 

0 Kudos
Reply