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

How to send an email to an individual after querying a list and for each loop

Jump to solution

All,

Slowly but surely learning Nintex forms and Nitex workflow.

I have a site workflow. The workflow is going to have to be scheduled.

It's first action is to query a list and collect various other fields:

I have a For Each loop

With 2 collection operations:

The end of my workflow has a send notification action.

The send notification sends an email to a named individual, yet how or where do I add another query list (?) or another action to specify that within the email I only want to show items which the named individual is named in the To field and

not all list items which was originally queried.

The named individual isn't necessarily known until the list has been queried, so I can't filter on the first list query.

Thanks

Andrew

Labels: (1)
Reply
6 Replies
murphybp2
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

I'm assuming you're trying to group all the entries from the list you're querying based on a person assigned to them, and then send a single email with all of those related items in the body of the email.  To accomplish this, you would need to have a loop within a loop.  The 2nd loop would need to do the work of collecting only those entries that belong to the person you're sending the notification to.  Assuming one of the fields you're pulling back from the first query is the person the notification goes to, I would sort the results from that query list by the person name.  Then in the second loop you can set a condition for it to run as long as the person for the current item equals the person for the previous item.  You would collect those records in a variable.  Once the names don't equal, that's your trigger to send the notification to the person with the records that belong to them, then start the process again for the new person.  

Reply
wilkies0106aw
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

Brendan et al.

I'm almost there. My workflow looks as the pictures below. Looking at my verbose logging. The forEach loop is working and filtering my list by whom an item is assigned to. The "collection" send notification action is showing the correct results. i.e. all my collection variables are working and the email is going to the correct person(s).

Yet, my final email outside of the loop is only going to one person and not everybody in an assigned to collection.

Any thoughts ?

Thanks

Andrew

1

0 Kudos
Reply
murphybp2
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

How is that notification configured?  If you're using a variable in the Send To field, how is that variable being set up?  Without seeing the details it's hard to advise where the problem may be. 

0 Kudos
Reply
murphybp2
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

Could you post an export of your workflow?  That may be the easiest.

0 Kudos
Reply
wilkies0106aw
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

Sorry didn't see reply Export attached.

Reply
wilkies0106aw
Nintex Newbie

Re: How to send an email to an individual after querying a list and for each loop

Jump to solution

This has annoyed me for a long time, but finally cracked it.

Recap: filter SP list (columns:id,title, assigned to etc.) and send an individual user an email with a list of items where they are the person named in the assigned to column.

Finished workflow is as simple as:

The 1st query list action :

The collection operator

For each

The 2nd query list (inside of the for each loop)

Note the 2nd ID Collection variable.

Send to action

Variables

0 Kudos
Reply