A Batch macro runs multiple times in a workflow, creating an output after each run. The macro runs once for each record or selected group of records in the data. Inputs can be configured to be used in each run of the workflow or only in specific runs.
Batch macros with more than one Control Parameter tool display a tab with input options for macro users. The tab does not display in the Interface Designer for macro creators.
From the Workflow Properties, select Batch Macro from the Workflow Type drop down.
Once the workflow is saved as a Batch Macro, each tool in the workflow gets a lightning bolt anchor . Only Interface Tools can connect to these anchors. This anchor indicates that there are Interface elements and actions updating a workflow tool.
Control Parameter: The Control Parameter is the input for each iteration in the Batch Macro. The Control Parameter input will act like a Question but these questions are answered by data in the stream, not by a user's selection. The Control Parameter will need an Action associated with it. The Control Parameter input will appear as a ¿ below its input arrow on the macro tool icon.
Configure the Batch Macro Properties, found in the Interface Designer (Ctrl+Alt+D) or accessed from the View menu. Click the wrench icon to view the Properties.
Output Mode: A batch macro will run, beginning to end, for each record that is passed through it and then union all of those iterations. You need to choose how to handle the union if the schema for each iteration is not the same.
All Iterations will have the same output schema (Error if different): This is the simplest option; Alteryx just takes the schema from the first run and assumes the rest will be the same. If they are not, you get an error. The advantage here is that we don't need to wait for all the records to come through to start pushing things downstream.
Auto Configure by Name (Wait until all iterations run): This will wait until all the iterations get run, and combine the schemas by putting fields with the same name into the same field. When they have different types, one will be chosen that can hold all the values.
Auto Configure by Position (Wait until all iterations run): This will behave like Configure by Name, but fields are matched up by their position in the record. Field Names will be set based on whichever iteration is the first to have a field in that position.
Additional Inputs: Some batch Macros will have additional inputs, some will not. If additional inputs are specified, the user will have a Grouping tab available to them on their configuration properties. If grouping is not specified (which is the default behavior) each iteration of the workflow will get all records from the additional inputs. When Grouping is specified the additional inputs will only get records which match the Control GroupBy field for that iteration.
©2018 Alteryx, Inc., all rights reserved. Allocate®, Alteryx®, Guzzler®, and Solocast® are registered trademarks of Alteryx, Inc.