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

Send Email through variable

Jump to solution

Hi, I'm having some difficulties with Nintex. I created a list in SharePoint, that contains two fields: Department (which is a simple text) and Name (which is a person or group). What i want to do, is get the e-mail of some people from a certain department. So this is what i did:

1 - I created a Querry List block, so I can get employees of a particular department. I also select only the column "Name" from the list, and since it is a "person or group" I select the property "work email". This, is returned to a collection variable (but there will always be only one result that match my search, so the collection has only one item).

2 - The next step, is a "Get Item from Collection", and this seems to be the problem. The Target Collection field at the "Get Item from Collection"  is defined as my collection, obtained at step 1. Since it has only 1 value, its index has value 0. The "output" is a variable of type person or group. So considering this works, the next step should be really easy.

3 - The last block is a send email block. The target, is the workspace variable returned from step 2. The problem is that I'm never getting the e-mail.

Am I doing something wrong in the process ??

This is my simple workflow:

Thanks for the help !!

Labels: (2)
0 Kudos
Reply
10 Replies
TomaszPoszytek
Nintex Newbie

Re: Send Email through variable

Jump to solution

it sounds like it should work. I also have similar solutions and they work. Why don't you try to log to history outcomes of every action, so that you will know what data you have in your variables?

Regards,

Tomasz

0 Kudos
Reply
murphybp2
Nintex Newbie

Re: Send Email through variable

Jump to solution

If you will always only have 1 result from your query, why do you need a collection?  Just store the result from your query in a text variable, then drop that in your send notification. 

Reply
TomaszPoszytek
Nintex Newbie

Re: Send Email through variable

Jump to solution

That situation occurs when SP field "People or Group" is set to be able to have multiple values.

If a field is set to contain only one value, then the returned value in Nintex would be a single "Person or group" not a collection.

However ‌ if you save a "Work e-mail" value as the output to the collection, then the element 0 may be as well a text value. Of course, you can assign it to "people or group" variable as well... In both ways that variable should be proper to send the e-mail.

Do you log the outcomes? Do you have any error in your workflow history? Maybe it gets suspended? Maybe the provided variable is different, than expected by the action? Maybe, in the end, account you are querying does not have filled in "Work email" field in SP User Profile? First thing - debug. To debug - log

Regards,

Tomasz

0 Kudos
Reply
emha
Nintex Newbie

Re: Send Email through variable

Jump to solution

you need not to pick an email from collection to a variable.

setting mail recepient to collection variable should work as well (as long collection contain valid emails or user udentifiers)

0 Kudos
Reply
igor_mendes
Nintex Newbie

Re: Send Email through variable

Jump to solution

Hi all, and thank for the help !!

I still haven't figured out what's happening. The workflow result is "completed", but the variable seems to be empty like in the photo below:

Where Potential Approvers is the list returned from the query search, and contact is the item got from the collection.

Thanks, Igor.

0 Kudos
Reply
TomaszPoszytek
Nintex Newbie

Re: Send Email through variable

Jump to solution

I see no "work email" in the collection. Are you sure you are getting the work email? Are you sure this account has filed work email attribute? From this collection, to get the value you need, you should use the JSON path: "Approver_x0020_Name/Title" using the "Get element from collection" action.

Regards,

Tomasz

0 Kudos
Reply
igor_mendes
Nintex Newbie

Re: Send Email through variable

Jump to solution

Hi Tomasz,

Yes, in the Get Collection Item I'm selecting the Work Email option. I really don't know whats happening here. The only way this is working is if i create a variable and type my name in its value field. This is the only way I'm receiving the e-mail. I tried creating the e-mail field in the list as a Text, not a Person or Group, and thats not working too. I'm thinking that the only way to make it work is by using a Regular Expression block, to extract the e-mail. But that seems to complicated for something that should be intuitive and simple. I made a lot of Log to History, and this are the results:

 

First I query the items from the list, create the collection. After, I get the items from the collection.

Please, help me, I'm trying to solve this for days

Thanks !!

0 Kudos
Reply
TomaszPoszytek
Nintex Newbie

Re: Send Email through variable

Jump to solution

This is really weird. One additional question - the e-mail where you are trying to send your e-mail is in the same domain as your tenant? It is not an "external email"?

0 Kudos
Reply
igor_mendes
Nintex Newbie

Re: Send Email through variable

Jump to solution

Hi all, and thanks for the help. I managed to solve the question. The option "Separate output per column" was not selected at the Query List block. This appears to have solve the problem. Thanks for all the help !!

Reply