I'm trying to get an email alert to show the following fields:
So I've created a For Each Loop:
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?
Solved! Go to Solution.
how do you populate single collection variables?
do they all have just the same number of elements?
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?
so is the problem that the number of fields in the Query action doesn't match up with the Collection operations?
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?
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.
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.
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.