community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Dynamically enabling / disabling workflow sections

Alteryx
Alteryx
Created on

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
Asteroid

This is an awesome solution, thank you!

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.