The Product Idea boards have gotten an update to better integrate them within our Product team's idea cycle! However this update does have a few unique behaviors, if you have any questions about them check out our FAQ.

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Standard Macros - Accept Arguments

Consider, for a moment, Standard Macros as old-school Subroutines in which you would have a library of Subroutines that could be invoked from numerous code sets.  Each Subroutine could have any number of arguments, and when the Subroutine is invoked, the calling code provides the arguments and their values to the Subroutine.

 

You can do this in Alteryx - but with a very large but.  The source field names being passed to the Standard Macro have to be the same field names the Standard Macro is expecting.  To make the Standard Macros more "library friendly" - allow the calling workflow to alias fields in the dataset for the sole purpose of sending them to the Macro.

 

Example:  Standard Macro that returns a Vendor ID based on a Location and Item Number.

Macro Input: Location ID, Item Number

Calling Workflow has: Purchase Location and Item Code

 

The Macro on the calling workflow would have a mapping:

Data Set ObjectMacro Input Object
Purchasing LocationLocation ID
Item CodeItem Number
2 Comments
patrick_digan
17 - Castor
17 - Castor

Hi @KenMorrill! I think you can do what you're looking for currently. On the macro input, you would need to check the "show field map" button: 

patrick_digan_0-1663244863156.png

 

Then when you use the macro, you would need to map the fields:

patrick_digan_1-1663244911424.png

Purchasing Location and Item code are coming from my dataset, and Location ID and Item Number were my field names in my macro. Mapping the fields actually changes them from their workflow name (Purchasing location/item code) to the macro's names (Location ID/Item Number). That way all the logic in the macro works. Since most users would expect the Purchasing Location and Item Code to come out of the macro, you can connect the macro input to a select tool via an action tool:

 

patrick_digan_2-1663245005329.png

The reverse field map just means that it will switch the fields back to the names from the workflow (Purchasing Location and Item Code for this workflow).

 

If you want more info, I have a tool mastery article and @MarqueeCrew put together a short video walking people through the reverse field map concept.

 

 

 

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Status changed to: Accepting Votes