Build a mapping

This walkthrough builds a complete inbound mapping: customer groups are imported from a JSON file into the Customer groups data entity. To follow it, use an inbound port whose data project contains the Customer groups entity, and the sample file customer-groups.json.

The sample file:

{
  "exportedAt": "2026-10-02T09:00:00",
  "groups": [
    { "code": "W10", "name": "Wholesale partners", "terms": "Net30", "taxGroup": "ST" },
    { "code": "R20", "name": "Retail customers", "terms": "", "taxGroup": "CA" },
    { "code": "E30", "name": "Online shop", "terms": "Net10", "taxGroup": "ST" }
  ]
}

The finished mapping fills the entity as follows, and writes the groups sorted by their code:

Entity fieldComes fromHow
CUSTOMERGROUPIDcodeDirect line
DESCRIPTIONnameFunction upper: written in capitals
PAYMENTTERMIDtermsFunction default: Net30 when the file has no terms
TAXGROUPIDtaxGroupDirect line
ISSALESTAXINCLUDEDINPRICE–Constant No

Step 1: Open the mapping in edit mode #

Open the mapping of the port as described in Open the mapper, and select Edit. A new mapping starts with two empty trees, each showing (not filled yet).

05-empty-mapper.png

Step 2: Fill the source tree from the sample #

  1. In the title strip of the left tree, select … to open the tree menu.
  2. Select Load a sample file....
  3. In the Select a file pane, select Browse and choose the sample file. The file is uploaded as soon as you choose it, and the pane closes by itself.
06-tree-menu.png
07-upload-dialog.png

The left tree now shows the structure of the sample: the groups array with the fields of one group. The badge at the right of each row is the type the mapper recognized: abc for text, 123 for a number, { } for an object or an XML element, and [ ] for an array or a repeating element.

Step 3: Fill the target tree from the entity #

  1. Open the menu of the right tree with the … button at the right end of its title strip.
  2. Select Fill from DMF. The tree is built from the fields the port's data project maps for the entity on the header.
06b-tree-menu-right.png

When the open Functions palette lies over the … button of the right tree, select the Functions caption to fold the palette. Folded, the palette shrinks to its caption and leaves the button free.

06c-palette-folded.png

Both trees are now filled: the sample on the left, the Customer groups entity on the right.

08-trees-filled.png

Step 4: Draw direct lines #

To draw a line, press the mouse button on the dot at the right end of a source row, drag to the dot at the left end of a target row, and release it there.

  1. Drag from code to CUSTOMERGROUPID.
  2. Drag from taxGroup to TAXGROUPID.

The first line goes from a field inside a repeating element (groups) to a field inside a repeating target element (the record CUSTCUSTOMERGROUPENTITY), so the mapper adds a loop by itself. The dashed line from groups to the record means that one customer group is written for each element of groups.

09-first-line.png

Step 5: Add a function block #

  1. In the Functions palette, open the String group and select upper. The block appears in the middle of the diagram.
  2. Drag from name to the input value of the block.
  3. Drag from the output dot at the right of the block to DESCRIPTION.
10-palette-pick.png

The palette groups you open are shown one under the other. When the function you need is below the edge of the window, fold the groups you do not need, for example Collection.

Step 6: Give a function a constant input #

An input that does not receive a line can take a constant value.

  1. From the Utility group, add the function default.
  2. Drag from terms to its input value, and from its output to PAYMENTTERMID.
  3. Select … in the title strip of the block. The properties panel shows the help text of the function and its inputs. An input fed by a line shows where the line comes from; every other input accepts a constant.
  4. Enter Net30 in fallback, and select Apply. The block now shows fallback = Net30.
11-function-panel.png

Step 7: Put a constant into a target field #

  1. Select … at the right end of the target row ISSALESTAXINCLUDEDINPRICE.
  2. Enter No in Constant, and select Apply.

The row shows the constant (= No), and every record receives this value.

12-target-panel.png

The … buttons of the target rows are at the right edge of the tree. When the open Functions palette lies over them, fold the palette by selecting its caption.

Step 8: Sort the records #

  1. Select the label of the loop (for each) on the dashed line.
  2. Enter code in Sort by, and select Apply.
13-loop-panel.png

Function blocks are placed in the middle column and can cover the label of a loop. Drag the block away by its handle (⠿) to reach the label.

Step 9: Save #

Select Save on the action pane. Saving stores the diagram and generates the XSLT script from it. Leaving the Mapping tab while the form is in edit mode saves as well.

The finished mapping:

10c-diagram-complete.png

Step 10: Test the mapping #

  1. Open the Test transformation tab.
  2. Paste the sample file into INPUT DATA.
  3. Select Run. The result appears in OUTPUT DATA.
16-test-transformation.png

The output is the document the data project imports. The complete result is attached as customer-groups-output.xml; it begins like this:

<Document>
   <CUSTCUSTOMERGROUPENTITY>
      <CUSTOMERGROUPID>E30</CUSTOMERGROUPID>
      <DESCRIPTION>ONLINE SHOP</DESCRIPTION>
      <ISSALESTAXINCLUDEDINPRICE>No</ISSALESTAXINCLUDEDINPRICE>
      <PAYMENTTERMID>Net10</PAYMENTTERMID>
      <TAXGROUPID>ST</TAXGROUPID>
   </CUSTCUSTOMERGROUPENTITY>
   <CUSTCUSTOMERGROUPENTITY>
      <CUSTOMERGROUPID>R20</CUSTOMERGROUPID>
      <DESCRIPTION>RETAIL CUSTOMERS</DESCRIPTION>
      <ISSALESTAXINCLUDEDINPRICE>No</ISSALESTAXINCLUDEDINPRICE>
      <PAYMENTTERMID>Net30</PAYMENTTERMID>
      <TAXGROUPID>CA</TAXGROUPID>
   </CUSTCUSTOMERGROUPENTITY>
   ...
</Document>

The groups are sorted by code, the descriptions are in capitals, the group without payment terms received Net30, and every group carries the constant No. A test run only transforms the text in INPUT DATA; nothing is imported into Finance and Operations.

For what the diagram can do beyond this example—filters, grouping, expressions, and editing the script by hand—see Work with the diagram.

Book a 30-min review