I have a simple workflow scheduled which collects data from a SharePoint list as variables. It runs a For Each action, pulling Collection variables and sending an email to the responsible parties.
I send an email to myself prior to the For Each action to test that the variables are being collected properly. The email Collection ( varCollTxtSendTo ) contains correct data - my email address in both cases.
In the Send an Email action at the bottom of the For Each set, I use the variable “varTxtSendTo” in the To: field. When I do this I receive NO EMAILS ( I am using my own email address to test in the Collection. )
If I add my own name manually to the To: section in the "Send An Email" action I receive all the emails – in this case, 1 which contains the Variable Test, and 2 emails which are sent for each respective list item it runs on.
Can anyone explain why this is happening?
Hi @SimonMuntz ,
The email you see is representative of my collection of variables.
This is just a test to make sure they are being collected. This is not the email that goes to each respective list item.
As you can see, each of the Collection variables are separated by a comma.
@SimonMuntz, this is happening automatically. Below is the email that sends the workflow variables to me. Nintex for O365 concatenates data held in variables with a comma.
The email in question is a part of the "For Each" action and should be picking one email address held in the variable "varCollTxtSendTo" based on my Count.
The "To:" section of this email pulls the data from the variable per Counted item, therefore containing only 1 email address to my understanding.
If I insert my personal email in the "To:" field, I receive 2 individual emails properly. If I use the variable, as above, I receive no emails yet it is my email address (for the purposes of testing contained in a SharePoint list which populate the Collection. Head scratcher.
Note: I have also attempted "Select return type" to format the "To:" variable as "Email Address" to no avail.
@SimonMuntz, I am using internal email service at the moment. I have tried external email service with the same results.
There are 2 emails because there are 2 line items in my SharePoint list that I am using for testing.
Thanks for your help !
@SimonMuntz, it's actually a very simple solution and it's based on user error. 😉 I am not actually Getting the Variable data for the email address in the For Each action. Thanks for persisting with me !