cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

workflow halt if using get item from collection when count is zero

Jump to solution

My workflow simply stops if I try to get and item from a collection and the collection is empty or the collection count is zero. Does anyone else have this problem?

 

I'm using a Regular Expression to get the the comment from a LazyApproval reply into a collection.

If the LazyApproval does not contain a comment (no , and comment) the collection is empty or has a count of zero.

When I use the get item from collection and get item zero if there is no comment (collection empty) the workflow simply stops dead in it's tracks.

 

Does anyone experience this problem? Is this how the get item from collection action is supposed to work? 

 

I've switched my workflow to test if item count is zero before running the get item to circumnavigate this problem, but that adds a number of actions that frankly I think are unnecessary. Shouldn't the get item from collection just return null if the collection is empty and allow the workflow to continue?

 

Thanks for any input into this.

Labels: (1)
0 Kudos
Reply
2 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: workflow halt if using get item from collection when count is zero

Jump to solution
Hi,

This sounds like expected behavior to me.
Basically a collection is an array. In programming if you were to say get me an item from the zero index of an array and the array is empty you will get an error. Checking to make sure the collection variable contains data by using a collection operation that does a count is only 1 extra action and a run if is only a second extra action do get around this behavior.

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: workflow halt if using get item from collection when count is zero

Jump to solution

Thanks Simon, this makes sense ... just needed confirmation.

 

Hey Nintex documentation - This might be helpful to note in the documentation; that querying an empty collection will cause get item from collection to halt the workflow.

0 Kudos
Reply