Skip to main content
All CollectionsTransforming Data
How to create and use Macros
How to create and use Macros

Create reusable macros from sequences of steps in your recipe

Thea avatar
Written by Thea
Updated over 3 years ago

Macros are user-defined sequences of recipe steps that can be referenced independently and parameterized as needed.

You can create reusable macros from sequences of steps in your recipe. These macros can be applied in other locations of the recipe or in other recipes.

Create a Macro

  1. In the Recipe panel, select the step or steps that you want to include in your macro.

  2. From the context menu next to one of the selected recipe steps, select Create or replace macro

NOTE: Steps do not have to be consecutive. In the macro, steps are listed in the order in which they appear in the recipe.

3. Enter a Name and optional Description value in the Create Macro dialog

a) The Name of the macro appears in the Trifacta application. Names must be unique.

b) Click Next

4. Specify (or create) any parameters

5. Click Create - It creates the macro and its parameters

6. An Apply transformation step with the macro's name associated with it is added to your recipe at the selected location.

To learn more about Creating a Macro, read this step-by-step documentation guide

Applying a Macro

You can use macros that you have created in other recipe locations.

Steps

  1. Through Flow View, edit the recipe into which you are inserting the macro.

  2. In the Recipe panel, click the recipe cursor to the location where you are inserting it. (See Recipe Panel)

  3. In the Transformer toolbar, click the Macros icon. (See Transformer Toolbar)

Click on Insert Macro in the dropdown menu.

4. The available macros are displayed in the right-side panel.

5. Search for and select the macro to insert. The macro is displayed in the Transform Builder.

  • Specify any parameter values required for the macro.

  • To add the macro to the recipe, click Add.

The macro is added as an Apply step in your recipe.

For more details on how to Apply a Macro, read this step-by-step documentation guide.

More Info

For more information, see Overview of Macros.

Did this answer your question?