Hello,
I'm trying to modify a workflow to build in a redundancy that would halt the workflow and send out an email if anyone of a set of columns are completely Null.
Does anyone have any ideas how I could achieve this?
Currently the workflow outputs a file and send an email.
Thanks,
Phill
Hi @Phill
You could use the Test tool to check the null criteria, which if all columns are null will generate an error message.
Then in the Runtime configurations there is an option to 'Cancel running workflow on error'
Final step is in the Events configuration you set it to send an email after a run with errors:
One downside to this is it will send the email whenever ANY error forces the workflow to stop, not just this specific one.
Hi @Phill,
It looks like what you are trying to do can be achieved by adding in a condition in your workflow that enables specific containers depending on when the condition is met. The two containers in your workflow would contain the following:
1) the steps to generate the error message to be emailed when a column is completely null
2) the steps to continue your workflow if none of the columns are completely null
This article by Roland Schubert (https://community.alteryx.com/t5/Blog-Deutsch/Output-Data-mit-Bedingung-Nur-schreiben-wenn-Tipps-Tue...) does a great job of explaining how to build in the condition in your workflow to enable or disable containers.
Hope this helps!
Thanks @DavidSkaife I've had a look at the test tool but I cant see any way to test for a Null column, do you have any examples?
Thanks @Denise_Santos, the post looks to be in German but I've done some resarch into this method. Looks like the workflows have to be nested in a macro? I'm not sure that would work for my purpose. Do you know of a way to have conditional containers within the same workflow?
Hi @Phill
Sure, here you go - a very basic example using three columns.
Using the Test Type of Expression is True for All Records, this expression will check to see if any of of the selected columns are null. This expression can be written directly into the Test tool:
!isnull([A]) and !isnull([B]) and !isnull([C])
This will fail even if you have values in a column , along with nulls. If you're wanting to check if all rows in the column(s) are null, and not just one (for example) then something like the below should work. A Summerise tool to count and count null, then a formula in the Test tool to check:
[CountNull_A] != [Count A]
and
[CountNull_B] != [Count B]
and
[CountNull_C] != [Count C]
I've attached the example workflow for you to look at, obviously it's very rough but I'm sure you can use it to tailor towards your exact use case.
Hi @Phill ,
Unfortunately, it looks like it does need to be contained within a macro. As for Roland's post being in German, turning translation on in Google Chrome has allowed me to examine the steps he took in English. However, as an additional point of reference, he provides the same guidance (in English, with the workflow template in English as well) in this post: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Enable-Disable-Containter-based-on-con....
Hope this helps!