Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Email tool - handling bad addresses gracefully?

I've got a workflow that takes an input table, does some prep, and uses the Render tool to build a customized message for the body of the email, so each recipient (one per row) gets a personalized message, and it works great - when all the email addresses are good.  The issue I'm having is that when even just 1 email address turns out to be "bad" (using my company's SMTP, so I'm assuming that Alteryx is doing an Address Book check before trying to send), the workflow halts and zero emails get sent, not even for the rows with good addresses (whether before or after the bad one's position in the table).


Is there a way to have the Email tool handle that gracefully, and successfully send the emails that it *can* send, and perhaps just post (or collect somehow) warnings about the bad ones that it was unable to send?




Found this thread after I posted, from a year & a half ago, it says:

"there is no way to continue the process on error as alteryx assumes that if an error occurs that something is wrong or incorrect in the data and should stop processing. If you have inactive emails in the list, you would need to find a way to filter those out upon run."


If that's still the case, bummer.  Hoping maybe there's been some improvement in the Email tool since then?

Alteryx Certified Partner
Alteryx Certified Partner

Hi @JasonTrippet 


Have you ever thought of using a Batch Macro? Send a single e-mail at a time, using a list of e-mail addresses as a control parameter.


This won't stop the error from the inactive e-mail addresses, but it will not interfere in the ones that are active.



Thanks @Thableaus !


I'm still learning, but that sounds promising.  Reading about the Control Parameter Tool & its interactions with Interface tools, my question is whether this would require user input at all?  The end state of my workflow is a scheduled recurring run from a Gallery, with no human input.  If it can be configured that way, it sounds like that's the solution.




Alteryx Certified Partner
Alteryx Certified Partner



It wouldn't require any user input.


You set up the Control Parameter to update (through Action Tool) the "To:" field from E-mail tool.


Then you bring this e-mail address list in a Text Input or a Field in your dataset to be connected in the control parameter anchor. Done, you'll iterate every e-mail address to send an e-mail.



Ok I figured out how to map the Control Parameter to a field (still enough of a rookie to get confused about needing to run an incomplete/broken workflow once in order to populate the datastream so that tools have things to pick from), but I'm stuck on the Control Parameter & Update Value tools not working as expected.  My datastream contains two records, the first with a bad email, the second with a good one, but when I run it I get two separate errors that indicate it saw the 2 records but for some reason it tried to use the first (and bad) email address for both records, rather than failing on the first then succeeding on the second.  The same datastream (which includes a field for the email address and a Render output for the email body) is going into both macro anchors, and then here's the macro canvas showing the config of the Update Value tool:

Workflow canvas.jpgMacro canvas.jpg


Why would it iterate on 2 records but use the same address twice rather than replace it?


UPDATE after tinkering with the data:


Ok it's actually trying to send 4 emails for some reason, using both records in the datastream (which have different data) to send an email for each record, to each email address in the dataset - rather than one email per record in the dataset, to the email address contained in each record.  Now I'm even more confused.  Does the field I'm sending into the Control Parameter anchor of the macro need to be just one record containing the name of the field to use ("Email") rather than the list of email addresses?


Thanks again for your help!


Alteryx Certified Partner
Alteryx Certified Partner

Hey @JasonTrippet 


I think the error might be that the control parameter is not properly updating the "To:" part from the E-mail Tool.


The configuration should be similar to this one:



- You must select the To - value option

- You must check the "Replace a specific string" option at the bottom and replace the full e-mail address.


Reminder: the list of e-mails coming into the Control Parameter should be consisted of unique values, because it iterates through each record, independently if they are different or equal. Otherwise you'll end up sending duplicate e-mails for your colleagues.


I think my Edit and your reply may have been simultaneous, so you may not have seen my description of the emails I'm sending.  The datastream has specific data per recipient, so that in the Render I'm using field references to personalize each email for each recipient.  But the effect of the Batch Macro is that it's sending a copy of each personalized email to each and every recipient in the control list - instead of my intended outcome of one email to each recipient.


I've been thinking about other ways to arrange the Render and Email tools inside or outside of the macro, but unless I'm missing something, I'm either stuck with:

1) sending personalized emails (as my original workflow does) but needing to validate email addresses and filter out bad ones, or

2) use the batch macro to handle bad email addresses, but the content of the email must be identical for each recipient.

No way to do both, as far as I can tell.



Alteryx Certified Partner
Alteryx Certified Partner



You could use an Iterative Macro instead of a Batch Macro.


iterative macro.PNG


- Change the type of macro in the Workflow configuration tab

- Set up a macro input with all fields you're going to pass as a parameter to the E-mail tool

- Use Sample tool to isolate 1 record at a time

- The other side, will skip the 1st record and go to the loop output (which will feed the Input next iteration)

- The iterative process ends up when the "loop output" has no records anymore.

- Don't forget to configure the Interface Designer tab and define the Input and Loop Output


This way you can bring a personalized e-mail paired up with each e-mail address.


@Thableaus cool thanks!  I'll give that a try and post back!