In , a macro is a saved sequence of one or more recipe steps that can be reused in other recipes. As needed, values in the recipe steps can be parameterized, so that instances of the macro can be configured for the recipe requirements.

Limitations


Enable

This feature is enabled by default. 

Examples

Example 1 - Reformat headers

Suppose one of your downstream systems has the following requirements for column headers:

You can do the following:

  1. For the recipe on which you are working, create a new recipe. 
  2. In this new empty recipe, add the steps to configure your headers according to the above requirements.
    1. No spaces. Underscores are ok:

  3. Select the above step. In the context menu for it, select Create macro....
    1. Enter a Name and optional Description value. Click Next.
    2. In the Create Macro dialog, you can review the step and its specified field values. 
    3. To save the macro, click Save.
  4. For any recipe that must generate results for this downstream system, you can insert this macro as the last step before publication. For example, you can delete the recipe where you made the macro and insert the macro reference in the preceding recipe.

Example 2 - Redact data for sensitive column data types

For security reasons, you may decide that sensitive information must be redacted before it is delivered as an output for downstream consumption. For the following data types, you may wish to remove the sensitive information at the end of your transformation process:

  1. For the recipe on which you are working, create a new recipe. 
  2. In this new empty recipe, add the following steps.
    1. Redact social security numbers:
    2. Redact credit card numbers: For this one, you can use the following transformation to mask the numbers except for the last four digits using :

      NOTE: The above transformation matches values based on the structure of the data, instead of the data type. If for some reason, you have values that are not credit card numbers yet follow the credit card pattern, those values will be masked as well by this transformation.

  3. Select the above steps. In the context menu for it, select Create macro....
    1. Enter a Name and optional Description value. Click Next.
    2. In the Create Macro dialog, you can review the step and its specified field values. 
      1. You may wish to parameterize the Find and Replace with values. For example, for some uses of the macro, you may wish to replace with an empty string or a value like ##REDACTED## like the previous macro. 
    3. To save the macro, click Save.
  4. For any recipe that must generate results for this downstream system, you can insert this macro as the last step before publication. For example, you can delete the recipe where you made the macro and insert the macro reference in the preceding recipe.

Create

A macro is created from a sequence of steps inside a recipe.

For more information, see Create a Macro

Apply

After a macro is created, you can apply an instance of it anywhere in your recipes. See Apply a Macro.

Manage

After macros have been created, you can manage them through the Library. For more information, see Macros Page.