Vadim Tabakman

Nintex Workflow - Wait for Item Change

This interesting question came up on the Nintex Community - Making the workflow wait for one of 4 fields to change.

Since the Wait for Item Update action in Nintex Workflow only supports one condition, how do build logic into our workflow that can check multiple conditions?

To get around the limitation of the Wait for Item Update action (single condition), we have to do some Workflow magic :).  Firstly, since there is the single condition limitation, and in this scenario, we have 4 fields that we want to potential wait for.  More precisely, we want our workflow to wait until any one of those four fields is changed.

In the above screenshot, we have a Title field (we are less interested in that changing) and then we have four fields, that we are interested in.

So what kind of Workflow magic are we doing?  Well, we focus on the Modified field.  This field changes automatically, every time an item changes.  Now, we can use the Modified field in the Wait for Item Update action.  But before we do that, we need to store some current field values into variables.  eg.  store the current Modified value into a DateTime variable, so that we can use that in the condition.

These are the variables in this workflow:

The Workflow Design looks like this :

From the above screenshot, the workflow isn't complex at all.  Firstly, we initialize our variable (text variables).  Then we jump into a Loop.  The reason we have a Loop, is because inside that loop, we have your Wait for Item Update action that will wait until the Modified field is changed.  This could happen for another field, other than the four we are interested in, like the Title field.  In this case, we want to loop around and go back to Waiting...

Here is what happens as the workflow starts :

Now if we change the Title field, this is what the workflow status looks like:

Notice how the Wait for Item Update action completed and then it went to the Run If.  The Run If ran, but the condition wasn't met, so the inside action (Set Variable) didn't run and therefore the workflow went back around the loop, and is now back at the Wait For Item Update action.

If we then modify the item in such a way, that one of the fields is modified that we care about, the workflow status will look like this:

Notice that everything is green, because we found a field that we are interested in has changed, we exited out of the loop and the rest of our workflow can continue.

So what does the Run If look like?

Since we have 4 fields we are interested in, the Run If is configured with 4 condition, all set with an "Or" operator.

The final thing to look at, is the Wait for Item Update action :

Notice that it's a single Wait for condition, and we are comparing the current Modified field to the DateTime variable we have.  The one main thing to remember here, is that the first action, just before the Wait for Item Update, should be a Set Variable action to get the latest Modified value and store it in the dtLatestModified variable.  That way, each time through the loop, we are using the latest value.

Below is the Workflow and the List Template from this post.  I hope this helps someone.  Feel free to add comments below.

Downloads

Nintex Workflow

Download the Workflow - Download and import into the New Workflow page

Download the List Template - Download, unzip an import it into the SharePoint List Templates

Gravatar
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Friday, May 6, 2016 9:01:02 AM
Mark Uden
Gravatar

re: Nintex Workflow - Wait for Item Change

Hi Vadim,

That's an interesting solution!

Can the "Wait for item update" action operate on a calculated field? If so, you might also be able to create a calculated field that concatenated the contents of the first four fields, then wait for changes to that instead. The obvious limitation would be that are some field types that can't be used by a calculated field.

Another possibility is to have a second workflow that ran conditionally on any of the four fields changing, then set another field to true. The first workflow could wait for this signal to proceed.

I guess your method is best if you don't want to add unnecessary fields to the list.

Regards,

Mark

Thursday, July 21, 2016 12:27:16 PM

re: Nintex Workflow - Wait for Item Change

Hi,

We have a similar requirement.  Our use case: cancel a Flexi task if Total Amount or Due Date changes.  We only want to execute the necessary code if either of those fields change.  I tried Mark's approach with a calculated column and you cannot wait for change on calc columns. Booo!  We created a column that we hide from the users that combines both fields and wait for change on that field.  It seems to be working as accepted.  I'll be happy to share the approach if you think others might be interested.

Regards,

Eric Halsey

 

Thursday, July 21, 2016 1:39:28 PM

re: Nintex Workflow - Wait for Item Change

Nice one Eric.  Great solution!!

Vadim

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register





 

Statistics

  • Entries (249)
  • Comments (1729)

Categories