Not applicable

How can I stop workflow when Query List returns Zero Reults?

Jump to solution

I've built a fairly simple workflow that queries a list for specific results; for each result, send email.    The workflow is working as long as the query returns at least one result.   

Problem:   If the query returns zero results, I get the workflow error:  Error operating on collection variable. Index property is greater than the number of items in the collection.

Can someone give some advice for how to handle this type of scenario?    

- Query List operation returns zero results, stop workflow

0 Kudos
Reply
2 Replies
bamaeric
Nintex Employee
Nintex Employee

Re: How can I stop workflow when Query List returns Zero Reults?

Jump to solution

Hi Matthew,

One option you can use it the Run If action.  You could put the For Each Match inside a Run If action, then configure the Run If action to run if the count is >= 1.  That way the For Each Match only runs if there are one or more results.

Another option is to use the Filter option before the For Each Match.  You can configure the Filter to only continue the workflow if there are one or more results.

View solution in original post

Reply
burkslm
Nintex Newbie

Re: How can I stop workflow when Query List returns Zero Reults?

Jump to solution

Eric's solutions should work.

0 Kudos
Reply