We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Conditional E-mail Tool

iamRandy
8 - Asteroid

Hi, I created a workflow with email tool options

 

1) Send e-mail IF there are records. I'm doing an email attachment.

2) Send e-mail IF there are NO records. I have a custom body email

 

if [Count]=0 then "There are no data available from reporting week of " + [Week Start] + ". "  else Null() endif

 

 

The issue i am having is that the workflow executes both #1 and #2 emails options are sent out.

The task is to send email based on the 2 options above.  For example, If on 3/1 there are 3 records, Option1 email should be sent out and not send Option 2; vice versa, if on 3/2 there are 0 records, Option 2 email should be sent out and not send Option 1.

 

Please advise. thanks in advance.

 

email_tool.png

6 REPLIES 6
FinnCharlton
13 - Pulsar

Hi @iamRandy , the email tool will send an email if there is a record flowing into it. You need to find a way to direct a record to the correct email tool based on the situation. One way to do this is with the "Count records" tool and a "Filter" tool. Use the "Count Records" tool to generate a count, and then filter based on "Count = 0". If there are no records and the count is 0, the record will be directed to the true anchor, and to the false anchor if there are records.

 

Another tip: You can use the "Report Text" tool to form better custom email bodies, rather than using a Formula.

OllieClarke
15 - Aurora
15 - Aurora

@iamRandy to add to @FinnCharlton's point - use the count records tool and append your data stream to it (count records connecting to the target input of the append tool) - this will ensure that there is a single value before your filter. Then you can link to separate bodies etc. and set up each email tool separately. 

OllieClarke_0-1678797422034.png

 

 

Hope that helps,

 

Ollie

 

iamRandy
8 - Asteroid

I did create 2 email workflow 1) eMail with Records and 2) email no records. The issue is when the workflow ran it sends both emails. I lost in your diagram before the append connection.  What my process should do,

 

1.) If there are records, attached the excel file in the "email with records" 

2.) If there are no records send an email with custom email body message

 

Somehow, i can't figure it out @OllieClarke i'm stuck before the append container.

 

2email_tool2.png

luis_boni97
6 - Meteoroid

Hi @iamRandy , Did you find a solution for you question?

iamRandy
8 - Asteroid

Yes

paliio
5 - Atom

Can you please share how did you resolve it? Struggling with this issue so much and cannot find solution.

 

Thank you!

Labels
Top Solution Authors