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

sent emails in a foreach doesn´t work

I have a nintex workflow that read a collection and sent one email for each item. For each element in this collection, have to read a item in other list where obtains the recipients of this emails.

In the 4th iteracction the workflow is suspended and show the following error:

System.Net.WebException: Exception encountered while processing the HTTP request. Exception details: 'HttpClient.SendAsync task was canceled. TraceActivityId=cc9dc52b-1b8e-dafa-bcf0-0097770175f0'.
at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.Activities.Hosting.HostedHttpExtension.HttpRequestWorkItem.HttpRequestWorkItemAsyncResult.End(IAsyncResult result, Int32& responseCode)
at Microsoft.Activities.Hosting.HostedHttpExtension.HttpRequestWorkItem.OnEndComplete(ScheduledWorkItemContext context, IAsyncResult result)

Labels: (1)
Reply
7 Replies
krishnachaluvad
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Hi,

Is it happening with 4th iteration every time?

Please try logging the item value before send email action and see what it is retrieving?

0 Kudos
Reply
marianmm
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Almost always in the fourth. I get a list of values of a field of the item. Each value is the title of an item from another list. From there I get the emails. I have changed this list of values and I still have the same problem.

It can be a problem of times when reading data from the other list?

0 Kudos
Reply
rogerb
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Have you tried using the same email address for every time you send it? Maybe there is an issue with the email address in the 4th one.

0 Kudos
Reply
krishnachaluvad
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Hi, Please try to log all variable into history, and examine the values including email, and see if the fourth item values are as expected or something wrong.

Reply
rogerb
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Yes! This is the best way I've found to troubleshoot workflows.

0 Kudos
Reply
rogerb
Nintex Newbie

Re: sent emails in a foreach doesn´t work

Are the email addresses coming from a collection? If so I would put the email value out to the wf history to check the value.

0 Kudos
Reply
marianmm
Nintex Newbie

Re: sent emails in a foreach doesn´t work

No. The addresses are stored in different variables because I get them from other lists

0 Kudos
Reply