Creating Mappings

Creating Mappings

Overview

Once you have schemas attached, you can create mappings between source and target fields. The DataMapper offers two primary methods: drag-and-drop for quick mappings and XPath expressions for more control.


Drag and Drop Mapping

The easiest way to create a mapping is by dragging a source field onto a target field. A line will be drawn between the fields to visualize the connection.

Example: Map the Name Field

Drag and drop to create a field mapping
Drag and drop to create a field mapping
Drag and drop to create a field mapping
Tip

Drag-and-drop is the fastest way to create simple field mappings. The DataMapper automatically generates the correct XPath expression for you.


Container Mappings

When you drag a container field (a field that contains other fields, such as an XML element with child elements or a JSON object with properties) onto another container field, the DataMapper automatically maps their matching children — you don’t need to connect each child field individually.

How Container Mapping Works

  1. Drag a container field from the source tree onto a matching container field in the target tree
  2. The DataMapper automatically pairs children by name and creates individual mappings for each match
  3. This works recursively — nested containers are also matched and mapped automatically
  4. Children that exist only on one side are skipped
Dragging a container field to automatically map matching children
Dragging a container field to automatically map matching children
Dragging a container field to automatically map matching children

For XML schemas, children are matched by element name and namespace. For JSON schemas, children are matched by property key. When mapping between XML and JSON, children are matched by name.

Collection Mappings

When both the source and target fields are collections (marked with the collection icon), the DataMapper additionally wraps the mapping in a for-each loop that iterates over each item in the source collection.

Collection-to-collection mapping with for-each loop
Collection-to-collection mapping with for-each loop
Collection-to-collection mapping with for-each loop

Mapping Line Styles

After creating a container mapping, you’ll notice different line styles in the mapping view:

Regular — A solid gray line. A simple field-to-field mapping.

Copy-of — A double dark line. The source and target XML containers have identical structure (same name and namespace), so the DataMapper copies the entire subtree efficiently.

Copy-of mapping shown as a double dark line
Copy-of mapping shown as a double dark line
Copy-of mapping shown as a double dark line

Complete — A dashed line with long dashes. All target children are mapped, and all nested containers among them use copy-of.

Partial — A dashed line with short dashes. Some target children are mapped, but not all have a matching source field, or nested containers are mapped field-by-field.

Mapping line styles
Mapping line styles
Mapping line styles
Tip

A partial mapping is not an error — it simply means some target fields don’t have a corresponding source field. You can add individual mappings for the remaining fields manually.

When Container Mapping Is Not Available

In some cases, the DataMapper will not allow a container-to-container mapping:

  • Mismatched field types: A container field can only be mapped to another container field. Dragging a container onto a leaf field (or vice versa) will be rejected.
  • No compatible children: If the source and target containers have no children with matching names, the mapping cannot be created.
  • JSON arrays: JSON array wrapper fields cannot be mapped directly — expand the array and map its children instead.
Tip

If a drop is rejected, try mapping the children individually instead of the parent container.


XPath Expression Mapping

For more control over your mappings, you can type XPath expressions directly.

Create a Mapping with XPath

  1. Double-click on a target field to activate inline editing and type an XPath expression directly, without opening the 3-dot menu.
Double-click a target field to enter XPath directly
Double-click a target field to enter XPath directly
Double-click a target field to enter XPath directly

Alternatively, you can click the 3-dot mapping context menu on the target field and click “Add Selector expression”

Select 'Add selector expression'
Select 'Add selector expression'
Select 'Add selector expression'

  1. Enter your XPath expression
    Type the XPath expression
    Type the XPath expression
    Type the XPath expression
Note

XPath expressions give you full control over data transformation, including string manipulation, calculations, and conditional logic. For complex expressions, consider using the XPath Editor.


Comment on a Mapping

Once a mapping is created, you can also comment on it.

  1. Click the 3-dot menu on the target field
Add comment in dropdown
Add comment in dropdown
Add comment in dropdown
  1. Add your comment
Add comment
Add comment
Add comment

Delete a Mapping

If you need to remove a mapping, click the trash icon Delete mapping icon next to the target field and confirm the deletion.

Delete mapping
Delete mapping
Delete mapping
Confirm mapping deletion
Confirm mapping deletion
Confirm mapping deletion

Tip

You can also delete a mapping by selecting the target field and pressing the Delete key on your keyboard.

Warning

Deleting a mapping is permanent and cannot be undone. Make sure you want to remove the mapping before confirming.


Next Steps

Now that you can create and manage basic mappings:

  1. Add conditional logic with if, choose-when-otherwise, and for-each
  2. Use the XPath editor for complex transformations with functions
docs