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. If needed, you can modify the steps in an instance of the macro to replace the existing steps, allowing you to make changes and updates to your macros.
Macros are user-defined sequences of recipe steps that can be referenced independently and parameterized as needed. A macro is composed of the following types of information:
For more information, see Overview of Macros .
In the Recipe panel, select the step or steps to include in your macro.
NOTE: Source steps from your recipe do not have to be consecutive. In the macro, steps are listed in the order in which they appear in the recipe.
From the recipe toolbar context menu, select Create or replace macro.
NOTE: The dialog name and options vary based on the selection of create or replace macros.
From the drop-down, select Create a macro. Enter a Name and an optional Description.
NOTE: The Name of the macro appears in the . Please verify that the Name is unique.
In the Create macro dialog, you can review the selected steps and the inputs for the macros:
Create macro inputs
A macro input is a variable within the macro whose value can be set to a default or, if needed, modified in each instance of the macro.
When you are specifying a macro, the reviews the steps of the macro to identify the values that can be modified in it. In the middle column of Steps tab:
|Column names are automatically turned into inputs.|
These two values could be turned into macro inputs but are not currently defined as such.
|These two values have been turned into macro inputs.|
Create macro inputs:
When you are defining a macro, you can create or modify macro inputs.
Tip: Macro inputs can be created or modified in the Steps or Inputs tabs.
Tip: Column names are always recognized as inputs. They can be modified as needed in each instance of the macro.
Specify its default value, and click Create .
To modify a macro input, click the entry in the middle column. Then, specify values as needed in the right column, and click Save.
To delete a macro input, select it in the middle column. In the right column, click Remove.
NOTE: You cannot delete column names as macro inputs.
When you edit a macro, you can modify the name, description of the macro, as well as the names for any of its inputs.
Tip: To modify the steps of a macro, you must replace it. See "Replace Macro" below.
After you have created a macro, you may need to convert an instance of a macro to plain steps in your recipe for any of the following reasons:
To convert a macro to steps, select the macro instance in your recipe. Then, select Convert macro to steps in the context menu of the recipe toolbar.
NOTE: This operation converts the selected instance of the macro to a set of steps. It does not modify the definition of the macro. If preferred, you can delete the macro, which forces all instances of the macro in the workspace to be automatically converted to steps. For more information, see Macros Page.
To modify the steps in your macro, you must perform a replacement of all steps in the current definition.
You can replace a macro's steps with all of the steps of a macro that you have exported to your desktop.
Tip: This method is useful for publishing changes to a macro from one workspace to other workspaces.
For more information, see Macros Page.
The following method can be used to replace a macro definition with steps that you have created in a recipe.
Tip: When replacing a macro, you can create new inputs for new steps and reassign inputs from the previous version to the steps that haven't changed.
Please complete the following steps.
Add, remove, or modify steps to define your new macro.
Tip: You may want to remove the comment steps that mark the beginning and ending of the converted macro.
If you want to save the copy of the existing macro, select the corresponding checkbox.
NOTE: Replacing an existing macro replaces all the macro steps with the steps of the new macro. All instances of the previous definition of the macro now reference the new macro definition. In some cases, you may need to reassign input values on old instances to align with the inputs in the updated macro definition.
Define macro inputs:
If the old version of the macro contained inputs, you should review those inputs and reassign them to values in the new macro definition.
NOTE: If you do not reassign the macro inputs from the old definition to the new one, then the values used for those inputs in macro instances created under the old definition are lost. After the replacement version is saved, you must review each instance of the macro to verify that it is working properly.
You can also create new macro inputs that apply to the added or modified steps.
See "Update macro inputs" below.
After you have reviewed the input, to replace the macro with the existing inputs, click Replace.
If you do not specify a relationship between the existing inputs and the replacement macro's inputs, a warning message is displayed.
NOTE: If you discard and save the changes, then any references to those inputs in the instances of the macro in the previous definition are broken.
Click Discard to save the macro.
When you are replacing a macro, the macro inputs from the old version are carried over into the new version that you are defining.
NOTE: To preserve the values that are stored in the macro inputs from the old version, you must reassign the old macro input to its corresponding input in the new version. If this reassignment is not completed, the input values specified in the old version are lost, and each existing instance of the macro must be reviewed and updated with new macro input values.
Reuse existing macro inputs
Repeat the above steps for each input.
When you inspect a macro definition, you review the steps that comprise the macro.
Tip: You can see the raw for your macros in the Library. For more information, see Macros Page.
You can use macros that you have created in other recipe locations. See Apply a Macro .
You can manage macros through the Library page. See Macros Page .