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

How Do I loop on a Grouped Value

Jump to solution

I have a document library that has a field called Manager.  There are over 30 managers.  I want to send 30 emails to each of the 30 managers along with all there associated rows.  I set up a WF that uses a Run Query first that retrieves the entire library for today's work.

Within the Query I have a Managers Collection,Log Description Collection and a Call Center Collection.

  1. I then do a For Each on the Managers Collection.
  2. I have a Get Collection Operation for Manager, Log Description Collection and Call Center Collection
  3. Outside of the For Each I have a Send Notification.
  4. Instead of getting 30 emails I get 1 email that displays all the log calls for all 30 managers.

I know I can set-up 30 Workflows and query for each manager, but there has to be a more efficient route.  Essentially I want to retrieve all data found for Manager 1 and send email, the next iteration would look for all data associated with Manager 2 and send email, etc...Perhaps I need to use a Loop in combination with a For Each

Labels: (1)
0 Kudos
Reply
2 Replies
Automation Master
Automation Master

Re: How Do I loop on a Grouped Value

Jump to solution

Hi

Were you able to resolve this issue or you need further help?

Reply
davidjohnson500
Nintex Newbie

Re: How Do I loop on a Grouped Value

Jump to solution

Yes.  Essentially I created 2 For Each Loops.  First I did a Collection Operation (post Query List) to Group on the ItemID.  I then did a For Each on the ItemID (too me this is essentially the Outer Loop).  I then did another For Each on the ItemID (but  NOT grouped; too me this was the inner loop) and grabbed all the detail rows if the Grouped ItemID equalled the Non-Grouped ItemID.  Once the inner loop was exhausted it iterated to the next Grouped ItemID (outer loop) and then entered the inner loop for the detail, etc.

I did a Build string within the Inner loop.  Once the inner loop was exhausted and before entering the next Grouped ItemID found in the Outer loop I send the email.

0 Kudos
Reply