cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

Hi

I'm trying to get an email alert to show the following fields:

So I've created a For Each Loop:

For Each

with twelve collection actions within to start to build up the fields. When I tested it (before I went any further) the workflow errored at For Each with:

'Error operating on collection variable. Index property is greater than the number of items in the collection' a snapshot of the collection actions is below, what am I doing wrong?

Labels: (1)
0 Kudos
Reply
17 Replies
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

how do you populate single collection variables?

do they all have just the same number of elements?

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

Earlier in the Workflow I have a Query list action which queries 17 fields, so is the problem that the number of fields in

the Query action doesn't match up with the Collection operations?

  

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

so is the problem that the number of fields in the Query action doesn't match up with the Collection operations?

no.

your query seems to be correct, I was afraid you popolate each collection variable with a separate query so you end up with different number of elements in each of them.

can you post configuration of 1 or 2 collection operations how do you read values from collections?

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

No problem, here's a few of them:

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

this seems to be correct as well.

do you perform any other operation on any of collection variables between query list action and for each loop?

especially if it is an action that might change its content.

can you proof-check that you haven't accidentally configured different collection variables in query list action and respective collection operation?

or perhaps  index variable?

or collection operation function?

if everything is configured correctly, then I would probably tried to disable all the collection operation actions within the loop and run workflow whether it passes through or not.

then I would tried to enable collection operation actions one by one and tested which works and which one fails.

Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

I tried what you suggested and disabled each Collection operation, then enabled them one by one and ran the workflow. It worked fine until I got to the 9nth Collection operation pictured below:

The text_cost_centre variable is a Single line of text variable, it stores a series of numbers and letters. The error t's throwing up is the same as before 'Error operating on collection variable. Index property is greater than the number of items in the collection.'..

I disabled this Collection operation and went onto the next but got the same error.

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

The Cost Centre Field in the list is a Drop Down Field. I changed the variable that the result is stored in to a Choice variable but still got the same error. 

0 Kudos
Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

Try disabling the 8th Collection operation and see if the 9th works.

Reply
Workflow Hero

Re: Workflow: Error operating on collection variable. Index property is greater than the number of items in the collection.

Jump to solution

Yes tried that and it errors. I'll post the full Loop workflow,

0 Kudos
Reply