Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Sending emails based on conditions

Shelbey
Alteryx
Alteryx

Hey Community. I am trying to send out emails that notify certain people when a piece of equipment gets an error code labeled "critical" but I'm getting stuck. I want to use more than just the filter tool because I don't want to be emailing out blank email attachments. What I have right now is a report that shows only the critical error codes and the event I scheduled will send that report. However, if there are no critical error codes, the report still gets emailed out but is blank. I need the workflow to run every 5 minutes so the recipient receives the notification almost instantly from the time the equipment logged the critical condition. What I don't want to happen is an email being generated every 5 minutes when the report is blank.

 

I've done some research and I think I need to use the Detour tool, but I am extremely unfamiliar with all of the interface tools and the developer tools and I'm hoping someone either has a different solution than those tools or can help me understand those tools and possibly apply the Detour tool to this workflow.

7 REPLIES 7
MichalM
Alteryx
Alteryx

@Shelbey 

 

A possible solution would be to only send the email on a successful run of a workflow and triggering an error if there are no critical codes. Use the Count Records tool followed by the Message tool with the following configuration

 

data-validation.png

 

 

The configure the workflow to cancel running if an error occurs - this can be done within Runtime setting of the workflow

 

cancel-workflow.png

Shelbey
Alteryx
Alteryx

Thank you! This was way easier than what I was trying to do! 

dmccandless
8 - Asteroid

I've seen this solution proposed across multiple threads, but it is not robust.

 

For example - if you have a workflow that could send 2 separate emails, if you conditionally throw an error to keep email 1 from sending, then email 2 won't send b/c the email tool won't send emails when there are errors in the workflow.

 

So, how can you solve for this problem?

 

I have two distinct email tools in my workflow (email A and email B). I ALWAYS need email A to send, I only need email B to send if a certain condition (e.g. record count). Because I ALWAYS need email A to send, I can't conditionally throw an error to prevent B from sending.

MichalM
Alteryx
Alteryx

@dmccandless 

 

You could use a macro with the 2 email tools in individual tool containers. Rather than throwing an error, you could dynamically enable / disable the tool containers based on a condition.

leahpenelope
7 - Meteor

Hi!

Could you show an example workflow? How would you create the macro in such a case?

Thanks!

rossjustin
6 - Meteoroid

Can you share a workflow for this?

SkyD
7 - Meteor

Hello, do you happen to have the macro on hand? I am trying to send an email when count > 0 titled "Please investigate" , and an alternative email when count = 0, titled " All good" .  However I am running into a problem, the email does not send when count = 0.

Labels