Skip to main content
Nintex Community Menu Bar

run if action and save in another list

  • May 19, 2019
  • 3 replies
  • 14 views

Forum|alt.badge.img+2

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.

3 replies

Forum|alt.badge.img+14
  • Scholar
  • May 20, 2019

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-display-the-sum-of-them/m-p/48962/highlight/true#M40579 


Forum|alt.badge.img+2
  • Author
  • May 21, 2019

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.

2242i2631C561BE99D723.png


Forum|alt.badge.img+14
  • Scholar
  • May 23, 2019

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 :)