Field assignments

You can use the "Field assignments" menu item to create an individual assignment between the fields defined in your customer's protocol and the fields available in our system.

On the left-hand side of the mapping tool, select the target field of the desired protocol (e.g. OCI), then select the desired mapping type (database, fixed value, dynamic (only for gateway mode).

On the right-hand side, select the source field and/or the value to be assigned to the respective protocol field.

Database: In the "Source field" field, select a field from our data model that is to be used as the data source for the selected target field during transmission.

Fixed value: In the "Source field" field, enter a fixed value that is to be output in the selected target field during transmission to the calling ERP system.

Dynamic: This assignment type is only available for the Gateway mode. Here it is possible to transfer and assign further data in the "product" object during the retransfer from the called shop system.

...
    "additionalProp1": [
          {
            "label": "string",
            "value": "string"
          },
          {
            "label": "string",
            "value": "string"
          }
    ],
...

Example: In the "product" object, you also transfer the "classifications" array, which in turn contains objects with the keys label and value. Here you have the option of storing the key description classifications in the first input field and the value of the key label in the second. The value field of the same object is now used for the field assignment.

What are field transformations?

Field transformations allow you to dynamically change values in your field mappings before they are transferred to the target system. You can use transformations to convert input values into other values based on defined rules.

Access to field transformations

  1. navigate to Field mappings in the main menu.
  2. select an existing field mapping or create a new one.
  3. in the detailed view of the field mapping, you will see a list of all mapped fields.
  4. next to each field is a green button labelled "Transformation(s) ".

Creating and editing transformations

To create or edit a transformation for a field:

  1. click on the green "Transformation(s) " button next to the desired field.
  2. a page area opens with the transformation settings.
  3. if no transformation exists yet, an empty assignment is automatically created.

Configuration of a transformation

Type of transformation

The transformation type "Replace value " (If transformation) is currently supported. This transformation checks whether the input value matches a defined value and replaces it with another value if necessary.

Add assignments

  1. enter the value to be replaced in the "Input value " field.
  2. in the "Replace with " field, enter the target value to be used instead.
  3. click on "Add further assignment " to define further replacement rules.

Fallback settings

Use payload as fallback: If activated, the original value is adopted unchanged if no match is found.

Saving or deleting transformations

  • Click on "Save " to save the transformation.
  • Click on "Delete " to remove the transformation.

Application examples

Example 1: Converting status values

If your source system uses status values such as "0" and "1", but the target system expects "Inactive" and "Active":

  1. create a transformation with the following mappings:
    • Input value: "0" → Replace with: "Inactive"
    • Input value: "1" → Replace with: "Active"

Example 2: Customise language codes

If your source system uses language codes in "de-DE" format, but the target system only expects "de":

  1. create a transformation with the following mappings:
    • Input value: "de-DE" → Replace with: "de"
    • Input value: "en-US" → Replace with: "en"

Example 3: Set default values

If you want to ensure that empty values are replaced by a default value:

  1. create a transformation with the following assignment:
    • Input value: "" → Replace with: "Default"
  2. deactivate "Use payload as fallback" and set the fallback value to "Default".

Notes

  • You can define multiple transformations for a field.
  • The number of active transformations is displayed below the field in the field mapping view.
  • Transformations are applied in the order in which they were defined.
  • Make sure that all input values and replacement values are defined correctly to avoid unexpected results.
PunchCommerce® ist ein Produkt der Netzdirektion GmbH