Maveryx Community Resources

Get up-and-running on the Community and with Alteryx in record time.

Apps and Macros Guide

MeganBowers
Alteryx Community Team
Alteryx Community Team
Created

Banner apps and macros.png

 

Heading 1 - Green.png

Getting Started

 

Macros and Analytic Applications are advanced topics in Alteryx—they fall under the Designer Advanced Certification. Luckily, the community has many resources to guide you on this learning journey.

 

So, what is a Macro? A Macro is a workflow or group of tools built into a single tool that can be inserted into another workflow. Macros allow you to run records or groups of records through a process and even loop through processes when needed. Creating a Macro will also save an analytic process you perform repeatedly. Once created, you can insert Macros into a workflow without having to recreate the looping logic or copy and paste the sequence of tools each time.

 

And how about an Analytic App? You can use an Analytic App to execute a workflow without having to open the workflow itself. Apps allow you to design a user interface for running your workflows, where users can input values that update parameters inside the workflow. Apps are great tools for end users who do not have Alteryx experience, as the interface allows them to interact with the data process without needing to know the ins and outs of adding or configuring tools on the Designer canvas itself.

 

Here is a summary of some of the differences between these solutions:

 

MeganDibble_0-1680032660546.png

Image from the Introduction to Macros in Designer interactive lesson

 

If you are brand new to Apps or Macros, then these interactive lessons are a great place to start:

 

Interface Tools

 

One of the similarities between Apps and Macros is that you use Interface tools to build them. To learn more about Interface tools, check out the help documentation.

 

Screen Shot 2023-02-24 at 2.38.51 PM.png

The Interface tools

 

The Action tool allows you to update the configuration of your workflow with values from the interface tools. Take some time to review this tool mastery article if you are unfamiliar with how this tool works.  

 

Interface Designer

 

Another similarity between Apps and Macros is that the Interface Designer Window can be used to customize the App or Macro interface. You can find the Interface Designer under the View tab in Alteryx Designer.

 

Screen Shot 2023-03-28 at 11.37.43 AM.png

  

The Interface Designer allows you to:

  • Add and delete interface design elements (like group boxes to group questions)
  • Test your App or Macro
  • Reorder interface elements
  • Customize the App or Macro controls (like changing the icon for a Macro)

 

Read more about the Interface Designer capabilities in this knowledge base article.

 

Heading 2 - Green.pngApps

 

You can convert a workflow to an Analytic App file type (.yxwz) in the Workflow Configuration window:

 

Screen Shot 2023-02-27 at 3.24.20 PM.png

 

When a workflow is saved as an App (or Macro), the anchors of tools in the workflow change to lightning-bolt icons. Only Interface Tools can connect to these anchors. This anchor indicates that there are interface elements and actions available to update a workflow tool.

 

Screen Shot 2023-02-27 at 3.28.49 PM.png

 

 

The recorded training Analytic App Development for Intermediate Users walks you through how to convert a workflow into an App and set up the graphical user interface (GUI).

 

Once you’ve made your App, there are several ways to run it. Double-clicking on the file will open just the App GUI. If you already have the App open in Alteryx Designer, you can click the wand icon to the left of the Run button to run it as an Analytic App.

 

app gif.gif

 

For more App examples and resources, check out this tool mastery article.

 

To get a sense of what you can accomplish with Apps, here are some interesting discussions to review:

 

And we also have some blog articles on Apps written by Community members:

 

Chained Apps

 

If you want the results of one workflow to be used in a second workflow, then you can chain two Apps together. One way this could be helpful is if you want to dynamically limit selection options in an App based on what the user has already selected. The Interface Designer allows you to indicate which App to run after the selected App finishes:

 

Screen Shot 2023-03-03 at 10.23.58 AM.png

 Image from the Chaining Analytic Apps Interactive Lesson

 

Watch this recorded training session on chained Apps for a deep dive into how chained Apps work and how to set them up. We also have a KB article on chained Apps with an attached example that you can review.

 

How can you use chained Apps? Take a look at these discussions to see some examples:

 

You can take chained Apps one step further by using the first workflow in the sequence to modify the XML of the second workflow—read all about it in this blog.

 

Heading 3 - Green.png

Macros

 

You can convert a workflow to a Macro file type (.yxmc) in the Workflow Configuration window. You will see there are four options for Macro types—we will dive into the main three in this section.

 

Screen Shot 2023-03-07 at 1.49.52 PM.png

 

Once you have created a Macro (or download one from the Gallery), you can bring it into a workflow by right-clicking on the canvas and then navigating to Insert > Macro. If the Macro you would like to insert is not open in Designer, you can click Browse and select a Macro from anywhere on your computer.

 

Screen Shot 2023-03-10 at 10.48.00 AM.png

 

There was a blog series titled “Macro May-nia" on Community in which authors used different metaphors to explain the Macro types and terminology. Add some fun to your learning by reviewing the articles:

 

Let’s learn more about each type of Macro!

 

Screen Shot 2023-03-08 at 3.16.37 PM.png

Image from the Types of Macros in Designer Interactive Lesson

 

Standard Macros

 

The simplest type of Macro is a Standard Macro. You can think of this as a workflow within a workflow. If you find yourself using the same combination of tools for processes repeatedly, you might have an opportunity to automate some of your work by creating a Standard Macro.

 

A key feature of (most) Standard Macros is that they have a Macro Input and Macro Output tool. These tools are the entry and exit points of your Macro, respectively. They allow you to bring data from your workflow into the Macro process and then output the results back into the workflow.

 

A great place to start with understanding Standard Macros is this knowledge base article: Getting Started with Standard Macros.

 

When you are ready to try out creating a Macro, follow along with this recorded training on building your first Macro.

 

Using interface tools in Standard Macros can be a nice way to make changes to python code without a user needing to edit the code itself. Learn more about this use case in this blog on Python Macros.

 

Python macro.png

A Standard Macro using the Python tool

 

Batch Macros

 

Batch Macros run multiple times in a workflow and create an output after each run. They run once for each record or a selected group of records in data. A key differentiator between Standard Macros and Batch Macros is that Batch Macros require a Control Parameter tool as an input. The Control Parameter tool determines how the batches of records are created—it will take the list of values and run the Batch Macro logic once per value.

 

When inserted into a workflow, Batch Macros have a distinct icon for the input—an upside-down question mark:

 

Screen Shot 2023-03-10 at 10.44.16 AM.png

 

Once again, you can begin with a knowledge base article: Getting Started with Batch Macros. And then, go through this recorded training on building your first Batch Macro.

 

You can review these discussion threads to see how to solve common data problems with Batch Macros:

 

If you find yourself asking when you should use the Group By function of the Batch Macro versus using the Control Parameter tool (or even both), this knowledge base article in the CS Macro Dev series may be helpful. There is another article in this series about reading in multiple files with different field schemas.

 

Group by.png

Group by functionality in Batch Macros

 

Iterative Macros

 

An Iterative Macro will run through every record and then loop the records back through the workflow, repeating the entire process as many times as is specified or until a condition is met.

 

Once you have Iterative Macro selected as your workflow type, you will notice that the properties in the Interface Designer change. The iteration input is the Macro input in the workflow that contains the records to use for the iterative process. The iteration output is the output in the workflow that contains the records that will loop back through the iterative process. You can also set the maximum number of iterations and what to do once that number is hit.

 

It’s important to pay attention to your data structure when working on an Iterative Macro. The better you understand your data and how the Macro’s process will change it, the easier it will be to anticipate what your data should look like after multiple iterations of the logic.

 

Screen Shot 2023-03-10 at 10.28.32 AM.png

 

For a great in-depth explanation of Iterative Macros, check out this knowledge base article. Then, test your knowledge by working alongside this recorded training: Build Your First Iterative Macro.

 

Learn more about applications of Iterative Macros from the solutions to these discussion threads:

 

Finally, there are a few blogs with Iterative Macro examples that you can read about. This blog contains a helpful step-by-step walkthrough of the process of creating an Iterative Macro. And this blog includes an Iterative Macro nested in a Standard Macro for building hierarchies.

 

Sharing Macros

 

Once you’ve created a useful Macro, you might want to share it with others in your organization. This knowledge base article answers common questions around sharing Macros: Sharing Macros in Alteryx Designer and Server.

 

When you share Macros, don’t forget that you can fill out the Meta Info to give others context about what the Macro does and specify which tool category the Macro should show in:

 

Screen Shot 2023-03-21 at 11.38.38 AM.png

Example Meta Info from the data cleansing Macro

 

Another option to consider is turning your Macros into a tool so that anyone can install it in Designer. For a step-by-step tutorial, check out this blog: How To Package Macros & Tools Into a .Yxi Alteryx Installer Tool File.

 

Heading 4 - Green.pngTroubleshooting

 

Sometimes it’s hard to uncover the root cause of issues. Luckily, when designing an Analytic App or Macro workflow, you can run a test that simulates the user experience. This is a handy feature that aids in troubleshooting. When the test is run, a Debug workflow is created and opens in a new tab in the current Alteryx session. Learn more about this feature in the help documentation. This blog on debug mode is also a helpful guide for getting to the bottom of errors.

 

Here are some discussion threads that answer common questions about debugging/troubleshooting Macros:

 

And here are some threads for troubleshooting Apps:


Do you have a discussion forum thread, blog, or other content on Community that has helped you when developing Apps and Macros? Drop it in the comments below. 

Comments
SGolnik
11 - Bolide
11 - Bolide

I just wanted to give a heartfelt thank you for putting this together! I wish this was available before I took the Adv Cert the first time, but I know with these extra resources I will have the extra study material to not let iterative and batch macros get the better of me on the test again!

kishorerabhinav
7 - Meteor

Awesome!

 

Thanks for putting this together.

Going to share this with my peers.

Mtako
5 - Atom

These lesson are the best.

 

Putting it all together and explaining in a simple way. It's easy to understand.

There are some details to cover but that's most part of the issues as the lesson said it.

Running test are the best way to validate if your macro is actually working and see if it could be used in other workflows.

I recommend if possible including a lesson about macros working on Alteryx servers.

That would be amazing.

 

Thanks for everything Alteryx, you guys are awesome.

Humza_Ahmed
6 - Meteoroid

Very useful guide - need more like this!

ddiesel
13 - Pulsar
13 - Pulsar

This is a very nice resource, @MeganBowers! I referenced this link in a training session for one of my user groups. Thank you 😊

MeganBowers
Alteryx Community Team
Alteryx Community Team

@ddiesel happy to hear it was useful for you!