Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask 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

9 REPLIES 9
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
16 - Nebula
16 - Nebula

@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!

karenss6
5 - Atom

Hello, I have the same problem, could you help with the solution, thanks!!!

jrlindem
11 - Bolide

@karenss6 This is made so much easier, now, using Control Containers.  You can use a Filter Tool to provoke one container or the other with the existence of any data, then simply have your workflow feed into the control container (or start inside the control container).

They require AMP to be one and version 2023.1+

Check those out and see if you can get this working.  -Jay

karenss6
5 - Atom

karenss6_0-1758913401118.png

I tried, but something is wrong, it keeps sending the 2 emails

Labels
Top Solution Authors