Alteryx Designer Desktop Discussions

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

Conditional Workflows

Ehatie
8 - Asteroid

Hello community, I'm wondering if there is a way to have alteryx run one flow, or another depending on a conditional property. I know the tool [Detour] allows to run either of two separate flows, but it depends upon a checkbox. What I'm looking for is a way to automate the checkbox to be checked if and only if, a logical condition happens.

 

In all basic terms, I want a tool, or combination of, that allows me to do something similar to a "Do if" from any programming language.

 

I have searched both google and the community and haven't found anything even remotely close, any help is greatly appreciated!

5 REPLIES 5
KaneG
Alteryx Alumni (Retired)

Hi Ehatie,

 

Take a look at this quesiton:

http://community.alteryx.com/t5/Setup-Configuration/one-module-to-execute-another-module/m-p/6372/hi...

 

And you may see that what you are looking for is the Conditional Runner Macro by @AdamR_AYX. Check out his Macro pack at http://www.chaosreignswithin.com/2015/10/crew-macro-pack-2015-q3-release.html.

 

This would enable you to start another module based on a condition.

 

Ehatie
8 - Asteroid

Hello KaneG,

 

Downloaded the macros package you mentioned, however I more or less understand how the tool would work. Just tell me if what I'm thinking is right.

The [Conditional Runner] will open a background flow which should end in a test tool, if the test is true, it runs the true output, else the other. However, the part I'm doubting is if I should truly use a test tool, or should just try to run the conditional workflow and make it so that it somehow fails.

 

Thanks!

KaneG
Alteryx Alumni (Retired)

Hi Ehatie,

 

Yes, that is one way that it can be done as depending on whether there is a failure the data will come out the other side of the conditional runner tool.

 

The other way to set it up would be to have a filter tool before the conditional runner that either gives the data to the conditional runner macro or not. The reason for the conditional runner macro still being needed some times in this case is that some tools do not like being in the workflow but not having any data fed to them. It also allows you to segment the process easier into different modules for large conditional flows.

 

Kane

Ehatie
8 - Asteroid

Hello again,

 

Could you possibly provide a working example, it would be incredibly useful for people who aren't used to using the macro.

 

Thanks!

KaneG
Alteryx Alumni (Retired)

Hi Ehatie,

 

Sorry about the delay, I don't happen to have a working example handy. However, if you didn't want to use the test tool like in your example, due to having to pass data between modules, you could use it in the way I described whereby you can set a field as your condition and then filter on that field. In the below example, I have used the CountRecords as my Condition field, however you could have any flow there to work out you're condition. Then append that condition back on and filter the fields based on the condition. You can then have a conditional Runner on each of the outputs of the filter to kick off whichever flow you need.

 

Image 001 - 20151110 - 151156.png

 

Kane

Labels