Skip to Content

Transformation Mapping Exports and Imports

Introduction

A mapping consists of all target fields or nodes and their corresponding scripts. These scripts may contain references to source fields or nodes or to project components, use functions, or contain other valid script logic. A mapping does not include target fields that are not mapped.

After you have completed a transformation mapping, you can export the mapping for reference, to share outside the project, or to reuse elsewhere. Mappings that have been exported can be imported into a transformation, with the ability to select whether existing mappings are overridden.

Limitations

Depending on the schema structure, certain transformation mapping exports and imports are not supported, as described below.

Schemas with Values and Attributes

Exporting and importing a transformation mapping is not supported with schemas that contain values that have at least one attribute, as visually indicated with # and @ symbols, respectively. For example:

target field value attribute mapped

Schemas with Special Characters

When importing an exported mapping that includes target fields or nodes whose names contain special characters, mappings for those target fields and nodes are skipped. Mappings for target fields and nodes that do not contain any special characters are imported successfully.

Target fields and nodes whose names contain any of these special characters are skipped:

- . $ & #

Export a Transformation Mapping

Exporting a transformation mapping can be done from either mapping mode or script mode.

To initiate the download process, in either mode, click Export along the top right of the target structure:

header export

The exported file is in JSON format and contains each target node and the contents of any scripts, if included. Note that new lines are indicated by \n. A sample export is included below:

Sample Export
{
  "mappings": [
    {
      "targetNode": "json$",
      "script": ""
    },
    {
      "targetNode": "json$item.",
      "script": ""
    },
    {
      "targetNode": "json$item.userId$",
      "script": "<trans>\njson$item.userId$\n</trans>"
    },
    {
      "targetNode": "json$item.id$",
      "script": ""
    },
    {
      "targetNode": "json$item.title$",
      "script": ""
    },
    {
      "targetNode": "json$item.body$",
      "script": "<trans>\njson$item.title$\n</trans>"
    }
  ]
}

Import a Transformation Mapping

Importing a transformation mapping can be done from either mapping mode or script mode.

To begin the import process, click Import along the top right of the target structure:

header import

This opens a dialog where you can provide the mapping to be imported:

select mappings file to import

  • File: Click the Browse button on the right to select a file that contains the mapping. The file must be in JSON format.
  • Upload: After selecting a file, click to upload the mapping and proceed to the next screen.
  • Cancel: Click to close the import dialogue without uploading a mapping.

After uploading a file, the next screen provides a list of mapping conflicts, if any, and presents an interface for selecting which mappings to use:

mapping conflicts

  • Target Field Has Existing Mapping: Target fields that already have an existing mapping that conflicts with the one being imported are listed on the left. Select the checkboxes of any target fields whose mappings you want to be replaced with those in the file being imported. You can also click Select All to select all fields, or Select None to clear all fields.
  • Target Field Does Not Exist: Target fields that do not exist in the current mapping but are included in the file being imported cannot be mapped. These fields are listed on the right.
  • Continue: Click to proceed to use the selections on this screen to merge the imported mapping with the existing mapping and return to the transformation mapping screen.
  • Cancel: Click to close the mapping conflicts screen without saving. The existing mapping remains unchanged.