viewing Apigee X documentation.
View Apigee Edge documentation.
The Data Mapping task lets you perform variable assignments in your integration. Use this task to map the output values of a task to another task's input values, as shown in the figure below:
The Data Mapping task lets you
perform variable assignments in your integration. The variables can be integration variables or
task variables. For example, you can assign values from integration variable
to a task variable
Y or from a task variable
Y to integration
X. For more information about variable types,
see Using variables
in Apigee Integration.
Configure the Data Mapping task
To configure the Data Mapping task:
- Go to the Apigee UI and sign in.
- Select your organization using the drop-down menu in the upper left corner of the UI.
- Click Develop > Integrations.
- Search for or select the integration to edit from the Integrations list and click to open the integration designer.
- Click Add a task/trigger > Tasks to view the list of available tasks.
- Drag the Data Mapping element to the integration designer.
- Click the Data Mapping element on the designer to open the Data Mapping configuration pane.
The following image shows the layout of the Data Mapping Editor:
Add a mapping
To add a mapping, perform the following steps:
- Click Open Data Mapping Editor.
The Data Mapping Editor lets you map input variables to the output variables, using the available transformation functions. The output is then available as a variable to any other integration task or trigger. For more information about passing data as variables, see Using variables in Apigee Integration.
- Configure the Input and Output columns:
- Drag a variable from the left-hand variable list into the Input column.
- Alternatively, click enter a value to input a literal or reference value.
- Enter an initial value (of type
Boolean) or choose an existing variable.
- To choose an existing variable, type an existing variable name into the search field.
- To create a new variable, click + Add new variable to enter the name and data type of the new variable.
- Click Done.
- Click + Add function on any input variable to view the list of
available transform functions.
The Data Mapping task lets you apply a number of data mapping functions to transform the data in the input variable.
To remove or delete the most recently added function, click the - symbol.
- Drag a variable from the right-hand variable list into the Output column. If the variable is not
available, click + Add new variable to configure the name and data type of the new variable. Optionally,
you can select whether to use the variable as an output of the integration, or as an input to another integration, as shown
in the image below:
The completed data mapping is available to view from the Integration editor, by clicking on the Data Mapping element, as shown in the figure below:
Supported data types
Apigee Integration supports the following data types for variables in the Data Mapping task:
- Strings and String arrays
- Integers and Integer arrays
- Doubles and Double arrays
- Booleans and Boolean arrays
Retry on failure
You can configure various retry strategies to handle errors in a task. The retry strategies allow you to specify how to rerun the task in case of an error. For more information, see Error handling strategies.
Using the Data Mapping task can be a powerful way to transform and pass key variables to various tasks in your integration. Here are a few tips to keep in mind as you build your integration:
- Mappings are run in sequence from top to bottom. That is, if input variable
Ais mapped to an output variable
Bin the first row, the variable
Bis available for mapping in the subsequent rows.
- In each row, the data type of the Input column must match the data type of the Output column.
To cast between types, use transformation functions such as
- There are no limitations on the length of transformation chaining. However, debugging large chained transformations can be difficult. We recommend keeping input transformations readable and splitting complex transformations into multiple mappings.
- If a mapping requires a fallback value, set a fallback value for the mapping. If you do not provide a fallback value, the
mapping returns an error when the input value or transformation returns
- When deleting a variable, make sure to delete any mapping that contains it.
We do not recommend using the Data Mapping task to loop over arrays. Instead, create a variable representing an element of the array and then map each subsequent element in a sub-integration. You can call the resulting sub-integration using one of the following tasks: