Ever wish you could save and reuse a workflow process that you’ve already created in Alteryx? Are you tired of repeating the same process over and over again? well I’m here today to reveal to you the wonderful world of macros.
But first, what is a Macro?
A macro condenses a workflow process into one tool that can be stored and used repeatedly. This will essentially save you time and effort as you can just utilise this tool instead of recreating the workflow. Isn’t that great?
How can I use it?
There are 3 types of macros in Alteryx: Standard, Batch and Iterative. For this blog we will focus on the standard macro (we will cover the other two in later blogs).
A standard macro basically allows the user to package up a process from a workflow and can be inserted into other workflows to automate those processes.
Let’s jump into a basic example:
Say you worked at a shelter, and you wanted to measure the amount of animal food you required to purchase based on the number of animals you had in.
Question: How can you repeat this process without having to recreate the workflow every time an animal is rescued?
Answer: A macro.
Step 1: Start off by creating the workflow you require. Here we want to give the shelter the ability to filter by animal type and calculate the number of food bags required by animal type.
Step 2: Now we can utilise the user interface tools, in this case we want to allow the user to pick from a drop-down option, we can manually input the values that we want to user to be able to change between. Then connect that to an update value tool; so that we can adjust the filter section from dog to our selected value. We can also change the number of food bags required based on different sizes of the food bags. Make sure you check replace a specific string field to only replace that part of the formula as the user selects a different bag size.
Step 3: Replace the input with a macro input and add a macro-output at the end of the flow.
Step 4: Save your macro and add a new page, create a new text input, and add new values so we can check if the macro is working. Right click on the canvas and click on insert, macro and your macro should appear. Then just run your workflow.
I really hope this helps!