Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.

Dynamically enabling / disabling workflow sections

Alteryx
Alteryx
Created

The Detour Tool allows alternative workflow paths to be run accoring to its design-time configuration. However, there are some cases where it doesn't allow the amount of control you need. The first case is where you need to programatically change the path based on the data in the stream at runtime. The second is when you have workflow streams that you may not want to be connected into a stream within a Detour and Detour End (as in the case of Inputs and Outputs).

 

For these cases, a better solution may be a batch macro controlling enabled/disabled tool containers within the macro. Disabled tool containers disable any tools within them. Batch macros allow dynamic control of virtually all tool configurations, including the enabled/disabled state of tool containers. Together, these two features can enable full dynamic control of workflow sections.

 

A simple batch macro design would look like this:macro_design.png

 

The Tool Containers will alternately be enabled/disabled by the Actions being fed by the Control Parameter. The Union gathers together whatever streams are present, and sends to the Macro Output. (Note that you may need to configure your macro to allow changing output fields (via Interface Designer) if your schema changes by condition.)  Please see attached functional example.

Attachments
Comments
Alteryx Certified Partner

This is an awesome solution, thank you!

8 - Asteroid

This is a great solution - so simple, too!

I had a much more cumbersome solution that was not reliable and took 10 times longer because of the behavior of the filter tool (letting the workflow continue for the false cases as well.

5 - Atom

@DanH I have a question. Firstly, thanks for the post, this helped me a lot get started with my problem.

However, in my case the "Macro Input" is not a file or a query, but a whole workflow. I am trying to union some things and I want to execute different workflows on the data that come out of the union, and not the initial data. 

In specific, if this union has 0 rows coming out, then I want to add a column saying that nothing was changed. If there are rows coming out of the union I want to add a column saying that something has been changed. 

 

I follow your steps, except when I try to make the macro I don't know what to put before the two different tool containers. Here are the two images: one of the workflow and one of the macro

macro image.JPG

workflow image.JPG