Map and Transform
Purpose of the function
The Mapping Editor allows attributes to be mapped and transformed, enabling individual adjustments to attribute values. For example, it is possible to combine multiple attributes or add additional characters.
Introduction
The Map and Transform function can be used to modify attribute values so that individual values can be created from one or more source attributes.
A transformation catalog is provided for this purpose, offering various options such as adding, filling or deleting characters.
Prerequisites and relations to other modules
The function can be executed in all three areas (Attribute Mapping, Key Attribute Mapping, Classification Path Mapping) of the Mapping Editor as soon as an attribute has been selected.
How to use
Once the “Map and Transform” function has been selected in the toolbar, a dialog opens.
This is divided into a title bar, navigation bar, toolbar, statusbar and canvas.
Statusbar
In the statusbar, as in the Mapping Editor in the title bar, the value preview can be changed using pagination. In addition, the result, i.e. the final value that is imported into OMN, is displayed.
Canvas
The canvas is roughly divided into two areas:
Source attributes
At the top of the dialog, there is a table widget with the heading “Source attributes.”
Below this, a transformation type can be selected from the transformation catalog via a dropdown, if desired. This allows the user to perform one of the following transformations on a source attribute:
| The transformations are described in more detail below in the chapter Transformation catalog - Transformations on attribute result. |
| A transformation can only be executed after a source attribute has been added. |
The table contains four columns by default.
-
Source attribute
Attribute from the mapping file that is to be mapped to the OMN attribute. -
Identifier
Automatically generated identifier for the source attribute (consisting of a “$” and the attribute name in lowercase letters), which can be used as the basis for further transformations in Transformation catalog - Transformations on attribute result (as the basis for scripts). -
Initial value
Shows the original value stored in the source file without any transformations. -
Current value
Displays the current value resulting from the transformation of the source attribute.
| Columns may vary depending on the transformation selection. Each transformation adds additional columns to add additional variables, e.g., characters to be replaced. |
The table is initially empty and does not contain any attributes unless a 1:1 mapping has already been performed. One or more source attributes can be added using the “Add source attribute” button.
If a mapping has already been performed, the source attribute used is displayed in the table.
The order of the attributes can be changed using the arrow symbols to the right of the button.
.png)
.png)
Transformation catalog - Transformations on attribute result
The lower section of the dialog only appears once a source attribute has been added for transformation.
In up to three steps, various transformations can be performed on the attribute result (result from the upper section).
Steps
The transformation area starts with an overview of the steps. A maximum of three steps can be added, whereby the next step can only be added once a transformation has been selected in the previous step.
It begins with “Step 1.” Once a transformation has been added, an “Add transformation” button appears next to “Step 1.”
When the user clicks this button, “Step 2” is added, and so on.
If a step needs to be deleted, the “Delete transformation” function can be used. This will delete the last step.
| Steps can only be deleted chronologically, i.e., only the most recently added step can be removed. |
The user can jump back and forth between the individual steps by clicking on the desired step.
Preconditions
The user can restrict the transformations to the attribute result in such a way that they only take effect under certain conditions.
There is a toggle for this: “Precondition active/inactive.”
If this is inactive, no preconditions are taken into account during the transformation.
As soon as the toggle is active, additional fields are displayed to further restrict the transformations.
A precondition always consists of an “if … then” relationship.
To do this, the user first selects a source attribute (e.g., color) using the first dropdown.
Then, the operator (e.g., equals) is selected using the second dropdown.
In most cases, an input field then appears so that the condition (e.g., green) can be entered.
This results in the following example:
If the color equals the value “green,” then…
(with possible transformation) search for the word “green” and replace it with “dark green.”
Transformation catalog
The transformation via the transformation catalog starts with a dropdown, which is initially empty.
It contains the following transformation options:
| Scripts and string templates can only be added in the first step. |
Once a transformation option has been selected from the dropdown, an additional table appears for making detailed settings.
These are specific to the respective options and are explained in more detail in the following chapters.
In addition to the table columns specific to the selection, there are always two columns on the right side of the table that apply to all options:
-
Previous result
Display of the result of the previous step (for the first step, the current result from the source attribute area is used) -
Interim result
Display of the result from the current transformation
Add characters
This transformation is used to add one or more characters to the current value (attribute result).
The table contains two columns that can be edited:
-
Added value
-
Input field, characters can be freely inserted
-
-
Character position
-
Dropdown with two options
-
Start of string
-
End of string
-
-
Example:
Current result: 12345
Added value: .abc
Character position: End of string
Interim result: 12345.abc
Fill characters
This transformation is used to add a specific character to the current value (attribute result).
The table contains three columns that can be edited:
-
Value length
-
Input field, only whole numbers can be entered
-
Specifies how long the final value should be
-
-
Filling character
-
Input field, any character can be entered
-
For example, if the value has 6 characters and should have 8 characters, the filler character is added twice at the desired position
-
-
Character position
-
Dropdown menu with two options
-
Start of string
-
End of string
-
-
Example:
Current result: 12345
Value length: 8
Filling character: 0
Character position: Start of string
Interim result: 00012345
Delete characters
This transformation is used to delete characters from the current value (attribute result).
The table contains two columns that can be edited:
-
Value length
-
Input field, only whole numbers can be entered
-
Number of characters to be removed
-
-
Character position
-
Dropdown with two options
-
Delete from start of string
-
Delete from end of string
-
-
Example:
Current result: 12345
Value length: 2
Character position: Delete from the end of the string
Interim result: 123
Search and replace
This transformation is used to search for a specific character or sequence of characters in the current value (attribute result) and replace it with a specific character or sequence of characters.
The table contains two columns that can be edited:
-
Search for
-
Input field, characters can be freely inserted
-
Only values that contain exactly these characters are considered
-
-
Replace with
-
Input field, characters can be freely inserted
-
The characters found are replaced with the specified value
-
Example:
Current result: Midnight Sky Blue
Search for: Midnight
Replace with: Mid
Interim result: Mid Sky Blue
Multiplication and division
This transformation is used to divide the current value (attribute result) by a specific factor or multiply it by a specific factor.
The table contains two columns that can be edited:
-
Operator
-
Dropdown with two available options
-
“X” (multiplication)
-
“/” (division)
-
-
-
Input
-
Input field; only numerical values can be entered
-
The factor is entered
-
Example:
Current result: 42,5
Operator: X
Input: 2
Interim result: 85
| This transformation is a mathematical transformation and is therefore only useful for numerical values or mathematical changes. |
Addition and subtraction
This transformation is used to add a value to the current value (attribute result) or subtract a value from it.
The table contains two columns that can be edited:
-
Operator
-
Dropdown with two available options
-
“+” (addition)
-
“-” (subtraction)
-
-
-
Input
-
Input field; only numerical values can be entered
-
Example:
Current result: 42,5
Operator: +
Input: 3
Interim result: 45,5
| This transformation is a mathematical transformation and is therefore only useful for numerical values or mathematical changes. |
Add String template
This transformation is used to transfer one or more source attributes to a template in order, for example, to specify a certain sequence so that various transformation combinations do not have to be performed for this action.
The table contains a column (input) consisting of a large input field.
To create a template, any number of words or characters can be inserted.
The basis is the identifier of a source attribute. This always consists of a “$” sign and the source attribute name in lowercase letters (e.g., $articlenumber).
One or more source attributes can be combined and positioned as desired and linked with additional characters.
Example:
Input: $height cm x $width cm x $depth cm
Interim result: 12 cm x 8 cm x 2 cm
Add script
This transformation is used to freely modify one or more source attributes via script so that they fit the customer-specific use cases.
The table contains a column (code input) that consists of a large code input field.
Similar to the string template, user-defined results can be achieved based on identifiers and code.
The syntax of the entered code can be checked using the “Check syntax” button.
Either a green message appears below indicating that the syntax contains no errors, or a red error message is displayed.
| This transformation option is a kind of expert function. The user needs programming knowledge. |