Skip to main content
Nintex Community Menu Bar

H, So I have a workflow that is scheduled to run monthly as a first step, next step is to interrogate a target list with a ‘Query List’ action.  Problem is I'm getting a first record that hits criteria but its not running through the whole list, It’s hitting the first record/ responding as expected / hits criteria fine and I get a notification email. Problem is that’s the only notification I’m getting, and I know there are more in that list that hit that criteria but are not sending me notifications for them.  I believe my list is not being looped through but I'm not sure what’s up.  Here is my workflow. 

  1. The first email disabled is just me making sure I have what I need into the ‘IF TRUE THEN’ and then I only get one email.  

 

I then get into the next step, ‘run if true’ but I’m only getting one response from what I believe is a correct hit to send a notification.  How do I have the workflow go through all the rest of the records and test / present if any of the other list’s records as well hit criteria and should be sending me notifications as well ?

 

Here are the records passed over, basically those ‘Not approved’ pass over fine/ expected / not acted on, its these that are ‘Approved’ I expect to see email on all of them and I am only getting email on record #3..  How do I get this workflow to show what should send email, records #4, #5, $6 is the question.

 

 

 

 

 

Hello!

You should be able to use the Loop for Each action to loop through each item returned in the Query List action output variable. As it hits on each item in that collection, you can put the Run if actions inside the loop and access the data for the current item focused on in the loop.

Here is a video that touches on it just a bit in the example shown.

Jason


Here’s another area for Nintex Automation Cloud showcase videos. Loop for Each is featured in the first row here.

NAC Showcase Videos


Hi JRoberts,  I’ve mostly got it but sticking point.  I get the number of records I expect in this updated workflow but see a problem.  Where the workflow is in fact now sending me five emails ( expected number of emails based on conditions )  each emails’ content is just for the first record that was tested.  Here are screenshots. Note: in my emails I capture / display ‘ID’, so I know they are all the same record but it seems to loop and email.  I’m not sure what to make of that, and thanks for helping :) 

  1. Setting the boolean var to be used in ‘Stop Processing’.  I have it set to ‘no’ and do not update that var in the workflow.  I don’t want / need to ‘stop it early’.  

              

 

  1. Workflow ‘Query List’ cfg with the output a file var

                        

  1. Here is the cfg for the ‘Loop for each’ and the Target collection of ‘items’ is from the query a list output, the file variable just above.

             

 

  1. Then Run if True sends email to each customer who get notification emails ( in this case five emails and are being sent to myself for now) which is the correct number of emails I expect, but they are all just that first record checked.  I this case #3 but thats just for me to know I’m sending emails with diff record numbers.

             

 


Make sure that for any data variables inside the “Loop for each” action, that you insert the variables from within the Current Item object inside the Loop for Each object.

 


Hi, I don’t get the current item option.  It’s greyed out.

 

 


Instead I’ve tryed to use the SharePoint Online to get the ids to loop through and neither work.

 

 


I can see all the id’s in an email variable SharePointOnline → output from query a list → ITEMS(ids) but it’s not looking / looping through them.  So I can get the SharePoint to in email to list / identify the item id’s problem is getting that’s happening in the loop action.  I only get the #3 record in five emails.

 

 


Your Output variable in the “Query a list” action needs to be an Object type variable.

Also, you do not need to set a “Stop processing” variable in the “Loop for each” action if you intend to interact with all the items in the Target Collection (which should be an Object type variable).


What ID’s I’m attempting to use are coming from the SharePoint Online menu option, If, what I’m seeing your saying, is I need to get that ‘Loop for each’ to present the option for ‘Current Item’ to be able to be inserted. But its grayed out.  This is a scheduled task, so no start event links to list, my data comes from a ‘Query a List’, and I have the ‘output’ as a file var but I am not getting the ‘Current Item’ to choose in the Loop.

 

 


Reply