10-14-2016 01:24 PM - edited 07-23-2021 12:07 PM
This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Control Parameter Tool on our way to mastering the Alteryx Designer:
The key component of any batch macro, the Control Parameter Tool is the gear that keeps things moving. Using the input, the control parameter accepts a field of values that will be used within the batch macro to reconfigure and rerun the macro for each of the standard input records - unless using the GroupBy feature that matches certain control parameters to buckets of records to be batched through the macro together. Adding this interface tool to any macro will upgrade it to a batch macro and will give you the ability to loop through macro configurations for added customizability. While one of the more sophisticated solutions you can build into your workflows, there are few problems you can’t solve with a batch macro:
To batch through input-type tool queries you need only to place your input in a batch macro, create a placeholding query, and map your control parameter to it with the action to update a specific string value:
Then place this macro in your workflow with your control parameter input being the query arguments to be cycled through:
This approach can be replicated with most input-type tools and queries, and can drastically save processing time if querying large tables for very specific results.
Dynamically modifying SQL queries (without using Dynamic Input)
Create dynamic filtering and expressions
Split your records into chunks, sometimes improving workflow performance
Note that it is possible to have multiple control parameters performing several updates throughout your batch macros. These will be supplied by the number of fields entering your control parameter input anchor (). However, all these parameters will be batched through simultaenously, in record order (I.e. control parameter 1 row 1 and control parameter 2 row 1 update together, control parameter 1 row 2 and control parameter 2 row 2 update together, and so forth – see an example in the attached v10.6 workflow Multiple Control Parameters.yxzp):
Want to learn more about how to build batch macros of your own? Try the App and Macro Tool Mastery!
By now, you should have expert-level proficiency with the Control Parameter Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.
Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.
Hi,
I am getting no results or error message when running the workflow with batch in the attachment. See screenshot below.
Anyone knows why? What did I do wrong?
Hi @Chenyu I also saw 0 records coming out of the macro.
I changed the size of the Month column in the RecordID tool to 2 and it now works for me:
I have 12 records coming out of the macro now:
No need to change the Group by fields in the macro configuration window, just leave them unassigned like this:
Cheers
Mike
Very informative, thank you.
Your article illustrated the "Update Value" method of the Action tool.
Could you please also add an example of "Update Value with Formula"? Especially - for Text Input, Input and Dynamic Input (with sql where it updates part of the select).
Also, is there a way to provide a default when the Control Parameter Tool's anchor it is not connected to, or when NULL is coming in?
.