Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Tool Mastery

Explore a diverse compilation of articles that take an in-depth look at Designer tools.
Become a Tool Master

Learn how you can share your expertise with the Community

LEARN MORE

Tool Mastery | Control Parameter

MattD
Alteryx Alumni (Retired)
Created

icon.pngThis 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 control parameter anchor.PNGinput, 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:

macro.PNG

Then place this macro in your workflow with your control parameter input being the query arguments to be cycled through:

workflow.PNG

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.

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 (control parameter anchor.PNG). 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):

Multiple Control Params.PNG

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.

Attachments
Comments
Chenyu
6 - Meteoroid

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?

 

error messageerror messageno resultsno results

MikeLR
8 - Asteroid

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:

MikeLR_1-1626265214748.png

 

I have 12 records coming out of the macro now:

MikeLR_2-1626265248100.png

No need to change the Group by fields in the macro configuration window, just leave them unassigned like this:

MikeLR_3-1626265322801.png

 

Cheers

Mike

 

vbeyder1
5 - Atom

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?