Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to create a batch macro with 2 control inputs to enable/disable containers per inputs

NancyS
8 - Asteroid

Hi,

 

I am creating a batch macro that checks input from a reference file. If the flag is true for the particular file name only then its input tool should work in the macro. 

 

I'm struggling to make this logic as i have to mention a combination of file name and flag. 

 

Ref file structure

File NameFlag
AccountTrue
CustomerFalse
ProductTrue

 

Please refer the attache images of macro and main workflow. I want to use 2 inputs in batach workflow, right now i have only 1. The control parameter (flag or threshold value to check if it is true or false. But along with this, I need the file name as well to control separate containers according to the file and flag combination

 

Could anyonone take a look at this please?

 

Thanks in advance

 

Nancy

6 REPLIES 6
apathetichell
19 - Altair

A batch macro can have unlimited control parameters but only one control input. Perhaps you can create a matrix being fed into the control input? In this case the flag and filename would be in the same stream and fed into the control input. Inside the macro one control parameter would update the action tool to enable the container with the input data and one action tool would update the input data itself (and have the required box unselected). Values have to be fed into the macro fro both action tools (enable/disable container and input file update) even if the file is blank and the macro is disabled.

 

NancyS
8 - Asteroid

Hi @apathetichell ,

 

Thanks for the quick response!

 

Could you please guide on how to add a matrix or a tabular data into the control parameter tool? 

 

I'm asking specifically for control parameter is because the condition tool present in macro cannot be connected to macro input tool.

So basically I'm facing issue while rearranging on the optimum set of tools i can use to fulfill the requirement.

 

Hope that explains the issue. Please let me know if you need further details

 

Thanks,

Nancy

apathetichell
19 - Altair

Hi - have you watched this video? https://community.alteryx.com/t5/Interactive-Lessons/Creating-a-Batch-Macro/ta-p/657923

 

There are two types of batch macro inputs - datastreams (streams of data from your workflow) and control parameters - the matrix grid I'm talking about. Control Parameters create control inputs on your batch macro (the other input selection on the canvas) and can modify activities in your batch macro. You can have multiple control parameters - but only stream will go into your control input on your canvas. Does that make sense?

NancyS
8 - Asteroid

Hi @apathetichell , thanks for sharing this. It helps as in to understand the idea of batch macros' functioning. However, I'm facing issues with the choice of tools.. For example, i want to create a condition, on the basis of which the containers can be enabled or disabled. If I take Control Parameter's input as "True" or "False" This should work, but apart from this True or False condition, I need to have the name of the input file as well, based on the combination value of File Name and Flag value (True/False), the containers should be enabled or disabled.

 

What I've tried.. I've used condition interface tool. But the problem is.. for condition tool to properly work, we have the option of Control Parameter as input. In this case, I'm not able to pass only column (Flag Value- True/False). My aim is to work with both fields File Name and Flag Value in order to control the containers. 

 

The solution i tried is referenced from here: Dynamically enabling / disabling workflow sections - Alteryx Community

 

OllieClarke
15 - Aurora
15 - Aurora

Hey @NancyS 

 

If you update the value via formula, and connect both control parameters to the action tool, you can reference them independently in your formula - something like this:

OllieClarke_1-1676897580328.png

Hope that helps,

 

Ollie

 

apathetichell
19 - Altair

Take a look at these - one is an App version (check out the interface designer settings) the other is a macro version (takes a boolean field and a string of a fieldname) using two control parameters.

Labels