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

Error operating on collection variable, advice on date triggered alerts

Jump to solution

Afternoon

 

I have a workflow that I want to loop through a list every day, store start dates, then later in the flow fire off alerts if today's date is one month, three months, or six months on from that initial start date.

 

I've set up a flow which adds the required dates to a 'Today's Date' variable, then runs and alert if the start dates equals the variable. That works fine, it's the scheduled For Each and Collection Operation I'm struggling with.

Here's how I've configured the 'For Each':

ForEach.png

 

and here's the Collection Operation:

CollectionOperation.png

I'm getting 'Error operating on collection variable. Index property is greater than the number of items in the collection.' when the flow hits the Collection Operation. What's the best way to proceed? All help appreciated!

 

 

Labels: (1)
Tags (1)
0 Kudos
Reply
11 Replies
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Hi.

 

Could you explain why you are using the Collection operation to do the same thing that is accomplished in the For each?  Both are setting Two_weeks_dates to the current item in the collection.

 

Also, is the Collection operation contained within the For each loop?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Thanks @ethurber thought I needed Collection Operation to store the information from the list? So I could just do a For Each and store in a Collection variable then use that to do the comparison in the Run IF action?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Hi.

No.  The for-each loops through the collection and stores each entry in the variable specified (not a collection variable).  From what i can tell from your screenshot, you have the for-each configured properly.  From that point, you can process that variable any way you want.  Just be sure that all of the processing is in the for-each loop.  When the processing is complete for that item, it will return to the top of the for-each and pull the next item from the collection and store it in the variable.  It will repeat until all items in the collection are processed.

I hope this wasn't more information than you needed.

Ed

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Thanks @ethurber that's really helpful.

 

So I want to store the user name and start date then have actions fire if the start date = the start date + three months. I have a query list action which is returning all the users names and start dates. What's the best way to store these variables so that I can do the comparison and trigger the actions?

This is how the For Each is configured:

Configure_For_Each_Loop.png
and here's the flow as it stands:

Two_week_Flow.png

 

Thanks for all your help!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Hi.

This is what came up with based on my understanding of your requirements.  It's a site workflow that is scheduled to run daily.  I'm assuming that you wanted to send an email to the employee (i can't read the label on you send email action)

First half of workflow.png

Second half of workflow.png

The query list action

Query list actionQuery list action

For each action

for-each.png

Run if action

run if.png

Collection operation

collection operation.png

Hope this helps.

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution
Thanks @ethurber I'll give that a go!
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

@ethurber  how would I configure the Calculate cut-off-date action? I'd need it to be the Start Date plus 30 days and then store it in the datCutOffDate variable in your example?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

The cutoff date is the current date - 90 days.  This is used to filter the query because you are not interested in any dates older than 90 days.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Error operating on collection variable, advice on date triggered alerts

Jump to solution

Thank you so much for your help @ethurber  . I'm a still a little confused by the cutoff date. For example I need the alerts to fire if the employee is one month on from their start date. So if their start date was the 16th I'd need it to fire send an alert on the 16th of December. So would I not get their start date then add a month in the Calculate Date and then would I need to filter the results later?

 

Thanks again!

0 Kudos
Reply