Attempting to send conditional email
Hello,
I am attempting to create an output email scenario where one email with a specific dataset attached will always send and a second email will send only if the dataset has output in it.
I attached a capture of how I currently have this set up but, I am thinking there maybe some Python script involved to fix this. Any help would be appreciated.
Thanks,
Ron
Best Answer
Answers
-
JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 296 Dataiker
Hi @Ron_vB
,You could use a python step, but a simpler way to achieve this would be to use a check on the dataset with a minimum record value of 1.
Then, add a "run checks" step in the scenario. You will need to check "consider warnings as failures".
In the "send message" step, for the field "Run this step", you can add "if no prior step failed".
If the dataset has at least 1 record, the step will pass and the message will send. If the dataset is empty, the message step will not run.
Please let me know if this works for you.
Thanks!
Jordan
-
Thank you for the response. I put a run check into the scenario but, I do not seem to have the same options as you. Am I running an older version maybe?
-
Ahhh ha! Yes now I see what I was missing. Thank you that worked correctly!
-
Hi @JordanB - Thanks your solution, it helped . But have a question. I have multiple checks set up for a dataset and one of them is to find the min record count. I have also set up a scenario with email reporters and in the steps tab i added the run checks as you advised by choosing the dataset. My check failed (because 0 records in dataset) but still the email reporters triggered an email.
Does steps and scenario email has a connect? how does the steps execute first and tells to trigger a email? Do we need to set up a run condition or?
Also for the dataset i have 4 checks, how the steps here will determine which check to be used ?
Thanks much in advance - NirmalEmail scenario
Steps
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,090 Neuron
You need to set a run condition. Or use a Send Mail scenario step rather than the scenario reporter. In any case please open a new thread if you have further questions. This thread has been marked as answered already.