Not applicable

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

Jump to solution

I have a list with inventory items and there's a column for owner.  I'd like to send each owner a single email with list of the items they own. Also, I'd like to include multiple columns of information for each item.

Reply
9 Replies
vadim_tabakman
Nintex Employee
Nintex Employee

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

Jump to solution

Hi Keith,

 

firstly, use a Query List action to query for all owners and store the result in a Collection variable.

Then use a Collection Operation actions to remove duplicates.

Next, use a For Each to iterate through each own in your collection variable.

 

Inside the for each, this is where you will have multiple Query List actions to get all the items for a specific owner and start building up the email using the Build String action.  Once you are done, you can use the Send Notification action to send that email.

 

cheers,

Vadim

View solution in original post

Reply
rucohen
Nintex Observer

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

Jump to solution

Hi Keith,

First of all thanks for your posts and contributions. I have also read some of your personal blog-posts in the past (i.e. regarding reusable workflows) and they are very useful.

I have also arrived on my own to your suggestion. However, when it comes to the Query List action inside the "For Each", I am having a hard time filtering for the specific owner. Ideally I want to query (filter) all items which pertain to an owner (in this case, I'm using the column RM - which stands for Relationship Manager). My thinking led me to believe that the RM name must equal the Owners collection variable (which already removed duplicates) coll_RMs.

However, I get the following error:

     The execution returned an unexpected error.

     Exception from HRESULT: 0x80131904

Any ideas what am I doing wrong?

I have posted more information on my workflow on the following thread: Single Email - Multiple List Items

Regards,

Ruben

0 Kudos
Reply
rucohen
Nintex Observer

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

Jump to solution

I meant to say, "Hi Vadim"

Reply
vadim_tabakman
Nintex Employee
Nintex Employee

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

Jump to solution

Hey Ruben ,

replace col_RMs with an actual typed in value and see if that works.  If it does, compare it to whats in your column/variable.

It's probably a particular structure of data that is causing the issues.

Vadim

Reply
rucohen
Nintex Observer

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

Jump to solution

Hi Vadim,

Thank you for suggesting that approach. First, I have been using item_RM (person-group variable) instead of the col_RM because that is the first one is where the col_RM "for each" action is stored in. Second, when replacing item_RM by an actual typed in value (persons or groups are read AD\user), the query still returns nothing. Strange!

The solution that I'm going to test is using a "text" field for the RM's instead of the "person or group". That way the query works since I already tried the filter. I will just need to see how to adjust the final bits so that the emails get sent to each.

Ruben.

0 Kudos
Reply
rucohen
Nintex Observer

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

Jump to solution

Well, things are getting really strange. I have added a column to my list called "RM name". I have also added a "Query User Profile" action to the nintex workflow. The Query User Profile action gets the Last Name of the "RM" column and stores it in 'item_RMname' variable) A history log confirms that the last name is obtained in the following format: "Cohen Pellico". I have ensured that the values in my new column "RM name" (text) reads in such format (i.e. Cohen Pellico again).

Subsequently, when I use the Query List action to filter all items where column "RM name" equals (or 'contains') variable "item_RMname", I get no results at all. However, if I type in "Cohen", I do get the results.

I have no idea why is this happening but it seems to me that variables do not work in Query List filters. Have you experienced this before?

0 Kudos
Reply
trish
Design Dabbler

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

Jump to solution

Hi Vadim,

I have nearly the same request, but my "who" column is contains muliple values.

Here is what my list looks like:

PROJECTTASKWHODUEDATE
A1person1;person2;person302/25/17
A2person2;person4;person602/25/17
A3person1;person202/25/17
B1person402/25/17
B2person1;person602/25/17
B3person602/25/17
B4person1; person202/25/17
C1person3;person4;person5;02/25/17
C2person4;person502/25/17

 

I need to send an email 3 days before the due date to the persons in the "Who" column BUT only for the tasks where they appear. I would like to send only one mail which will display all the tasks the person has to complete instead of one mail per task.

Example: 3 days before "02/25/17", the site workflow is supposed to send a mail to each person in the "who" column.

I assume the mail is sent to person1:

Dear person1,

Please complete the following tasks before 02/25/17 :

Project A

Task 1

Task 3

 

Project B

Task 2

Task 4

 

Now the mail is sent to person3:

Dear person3,

Please complete the following tasks before 02/25/17 :

Project A

Task 1

 

Project C

Task 1

 

Hope it is clear!

Any idea?

Thanks for your help

 

PS: I have an on-premise version

0 Kudos
Reply
rucohen
Nintex Observer

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

Jump to solution

Given the complexity, an alternative solution could be:

Store your tasks in a list.

Create a webpart page that uses a 'current user filter' so that any user who visits this page can only see their tasks. You will need to investigate how to connect the 'current user filter' to the "WHO" field from the task library webpart that you need t add. You can display the tasks with the due dates here.

Create a workflow with 1) query list: to store all task owners in a collection variable. 2) collection operation to remove duplicates. 3) For Each "WHO" 4) send email with a link to the webpart page & state that tasks due deadline is about to expire.

Alternatively, inside the foreach, you may be able to calculate which is the closest deadline (date) and save it in a variable and use it in your email. Not sure how to do it tho.

0 Kudos
Reply
Iraj
Nintex Observer

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

Jump to solution

Hi,

I believe you are expert enough to request your assistance on an issue I've been struggling for a while.

I need to send a simple notification for all the users in a list that the client email is listed in a column. 

How can I collect the clients emails, avoiding repetition and send them notification only once? 

Need your help. 

Thanks in advance. 

James

0 Kudos
Reply