We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Skip a macro when no control parameter value

hcho
8 - Asteroid

Hi Alteryx Community,


I’ve built a macro that takes in a control parameter value and two data inputs. This macro is part of an If condition stream in my workflow. However, there are cases where no control parameter value is passed to the macro, which results in an error (screenshot attached).


To avoid the workflow stopping due to this error, I’d like to find a way to skip the macro's operation entirely when no control parameter value is provided. The rest of the workflow should continue as usual.


In short, is there a way to bypass the macro's execution when the control parameter value is empty or missing at the ? anchor? Any tips or workarounds would be greatly appreciated!


Thanks in advance!

8 REPLIES 8
alexnajm
18 - Pollux
18 - Pollux

Can you use Control Containers and the Use Case #3 option? Control Containers: Take Control of Your Workflow - Alteryx Community

OTrieger
13 - Pulsar

@hcho 
Another way will be to use the Detour tool.

There are even more complex solutions for this.

However @alexnajm  solution would be must easier to implement.

hcho
8 - Asteroid

Thank you for suggesting the use of a controlled container! It’s a great approach, but I ran into an issue—since I need to union the outputs, an error occurs when the controlled container does not run.

alexnajm
18 - Pollux
18 - Pollux

I'm sorry, but I don't see unions in the attachments provided so we will need more context in order to help further

hcho
8 - Asteroid
To provide more context, this macro is used within another macro, and its output is combined with other results to generate the final output.
When an input goes through the control container and produces a valid output, everything works as expected, as shown in the success attachment. However, if the control container does not run, the union input is left unconnected, leading to an error - no incoming metadata.
alexnajm
18 - Pollux
18 - Pollux

I am not sure I am getting the same issue, here's a simple version attached that works fine - maybe because of the macro? In that case, maybe you can force a blank row so at least something comes out of the container

 

Otherwise a Detour tool as @OTrieger mentioned could work well if you have a value from a macro/app to shift the workflow!

Skip a macro when no control parameter value.png

OTrieger
13 - Pulsar

@hcho 
That is why Detour tools will give you the most simple solution for that, as you will have 2 different routs and always one is disabled and no need to worry on any union. 

OllieClarke
15 - Aurora
15 - Aurora

@hcho 
In the past, before control containers were a thing, I would 'disable' a macro by putting its contents (bar the outputs/interface tools) in a disabled container, and then enabling the container if the control parameter had a length >=1.

Labels
Top Solution Authors