The Map JSON List or Object step (Map step, for short) helps you align data between connectors.
Before you can send data back and forth, you may need to map fields so that both connectors will be able to properly sync, send, and receive data. The Map step helps you do this.
Step Inputs
In the Edit Step menu, you can add details about the step configuration as needed for your flow.
Step Detail
List or Object
Define the collection of data you want to map. This value is typically an expression that either identifies a previous step’s output or the trigger event information that triggered the flow.
Example input:
Array Map
This option is off by default. Toggle this option on to create a nested array or object. Nested maps work exactly the same as standard maps: identify a List or Object, name the output properties, and set their values.
Property Name
Enter a name for the property you want to create or write to as an output of this step.
Value
Define how this property gets its data. Enter an expression, string, integer, or true/false statement in this field.
Step Dependencies
The Map step is dependent on another step in the flow. After saving your flow step, the dependencies section populates automatically with the following default values:
Dependent On Step Id: ID of the previous step
Dependent On Step Result Status: Successful
You can keep the default values or manually enter other values. The Dependent On Step Id field is required.
Note: If you rearrange the order of steps in your flow, the default Dependent On Step Id value will update to match the ID of the previous step. However, if you manually define a step ID in this field, it will not change even if you rearrange the order of steps in your flow. You can enter the ID of any previous step in this field.
MiniMap
Select MiniMap at the top of the step editor to view a high-level outline of all the properties and arrays you entered in the Map step.
Hover over a property name to see the value. Or select any item in the MiniMap to jump directly to it in the step editor.
Step Status
The following statuses may result after running the Map step:
SUCCESSFUL
Occurs when data successfully maps from one system to another.
EXCEPTION
Occurs when there is an exception that causes the step to fail. Because the step has failed, the flow can’t complete.
View the flow run details to see the exception error message, which lists the failed step, property name(s) causing issues, and reason(s) for the exception.
FAILED
Occurs when data cannot map from one system to another and the flow fails.
Step Outputs
The output of the Map step is the mapped fields between systems—the properties and associated values that you named in the Step Details section.
The output of a Map step is an array of objects. This array can have zero, one, or many objects in it. To access the property of a specific object, you will need to include the index of the object. [0] is the first element, [1] is the second element, and so on.
For some Map steps, the output is straight mapping, pointing one property to its equivalent in the other system. For other Map steps, the output includes new properties and values you defined in the Step Details section.
Use Cases and Examples
For example, if you need to move employee data between two systems, from payroll into HR, you may need to map the fields in these systems before you can transfer or sync data.
Let’s say you need to sync age and birthdate information. The payroll system has a birthdate field, but no age field, and the HR system has both birthdate and age fields. You can use the Map step to add an Age property for every employee based on the birthdate property.
In the List or Object field, start by defining where the platform can get employee data.
This example indicates that employee data is coming from the output or a previous flow step that retrieves employee data from payroll.
Then define the new property you want to create to be able to map data. In this case, the Age property, with a value based on the birthday field. You can use JavaScript libraries and flow helpers when you write property values. Note the use of flow.mapItem() to access the iteration data since it's inside a map step.
This map step will create an age property and calculate the value for each employee in the data collection you specified in the List or Object field.
There may be instances when you’ll need a straight mapping from one property to another, such as Birthdate to Emp_Birthdate. Then you would enter the Property Name and Value as follows: