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

How do you send one email for multiple list items

Jump to solution

I saw the below post which comes close to what I want to achieve.  However, I want to send the entire Query List (10 columns) out as an email.

I tried a Query List and Send Notification only as part of my workflow.  The Query List when I execute it retrieves all 5 of my records as expected.  However, the email only displays one item from the list.  I have spent 2 hours researching this and it appears I may need to create a Collection variable, however I am very confused on why this is required ?  Do I need to create 10 Collection variables for my 10 columns...One post suggested a For Each, but what is the purpose of a For Each when I do not want to send out an email for each list item. 

I use Nintex with SharePoint 2013 Enterprise.

Thanks !

how do you send a single email for multiple list items?

Labels: (2)
Reply
16 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How do you send one email for multiple list items

Jump to solution

Hello David Busch​ -

You would not be using the For Each loop action on the list, but the collection that you queried from the list.

The query filters down to the items you want to target, then loop through that collection to get the pieces you want, build out strings that you want in the email, and then put it all together in a notification.

You may want to check out Repeating section as html table in mail and look into using XSLT as it may be more of what you are thinking.

Hope this helps!

Reply
Highlighted
Not applicable

Re: How do you send one email for multiple list items

Jump to solution

Let us know how you make you, David Busch​. Thanks!

Reply
Highlighted
Nintex Newbie

Re: How do you send one email for multiple list items

Jump to solution

Thanks Jesse..Can yo refer me to an example of how I loop thru a collection...in the query list do I need to create 10 collection variables for my 10 columns or do I only set a collection variable for the List ID.. thx !

David B

Reply
Highlighted
Nintex Newbie

Re: How do you send one email for multiple list items

Jump to solution

Do I need to create multiple collection variables (12) within the query list.  Or do I create 1 collection variable.  Still puzzled on how the collection variable works within the query filter collection and the required loop to retrieve the pieces.  If you have a URL that may show a similiar example that would be great.

Reply
Highlighted
Nintex Newbie

Re: How do you send one email for multiple list items

Jump to solution

After researching further can you confirm I need to do the following:

  1. Query Filter
  2. Collection Operations (I need 10 collection operations) for my 10 columns that I need for the email
  3. Build String
  4. Loop
  5. Notification

For the Loop is the condition where the Collection ID = ListID

Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How do you send one email for multiple list items

Jump to solution

You would need to create a collection variable for each.

For example, if you have a list with Title, Start Date, and End Date as your columns, and you want to query the list to get all items with a specific Start Date, you will need a collection variable for all columns you want to do something with. So, in your Query list action, you will filter the list based on your needs and grab each field need.

We do this so that if there are multiple results, we can iterate through them and do something with that data.

Once you have the collection variables, you can use a For each loop and loop through each record to get to the specific items, like so:

Here we look in the titleColl variable and store the next one (based on index) in title

For Each title we get the Start Date and End Date in the index position from the StartDateColl and EndDateColl respectively.

Now that we have the specific data from the item, we can comprise an email that is specific to an item within the list we queried:

Hope this helps!

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: How do you send one email for multiple list items

Jump to solution

This definitely helps.  One clarification I need though is in your original post you said I did not need a For Each ?  Also, mp lan is to send out one email daily to 1 person only.  The email will be a dump of all items in an Active status.  thanks !

Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How do you send one email for multiple list items

Jump to solution

Hello -

In my original post, I meant that you would not want to use a For Each loop to send the notification (like my example above). You will want to use a For Each loop to gather all your necessary variables, build your strings, and then create ONE notification after you have ran through the loop.

Sorry for the confusion, its been a long weekend!

Hope this helps!

Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How do you send one email for multiple list items

Jump to solution

Hello David Busch​ -

Yes you will need a collection variable for each column you want to get and use later, and then an "item_Variable" (what I call them ) to store the individual variables.

I went ahead and made a quick site workflow to demo the following:

  • Query List
  • Collection Variables (how we store the list item's details)
  • For Each loop (how we get to the specific details for a specific item)
  • Build a string (to use in a notification later)
  • Sending a notification with ALL of the queried details

Workflow:

Workflow Variables:

Let me know how this goes for you, but you can create a new site workflow and then import my attachment to see how I hooked everything up.

Hope this helps!

Reply