Skip to main content
Version: Next

Transformation Pipeline

The transformation pipeline takes the value read from the Source of a mapping entry and converts it with a chain of operators. Each operator consumes the output of the previous one.

Transformation PipelineTransformation PipelineTransformation Pipeline

Every operator accepts certain input types and produces one output type. The Transformation Result panel shows the current result type and, when a preview file is loaded, the result for the record currently displayed.

The result type matters beyond the preview: it decides which fields the Data Target offers. A pipeline ending in Date can only be assigned to a date field. If an operator receives an input type it cannot handle, the configuration is rejected with an error naming the operator's position in the pipeline.

Edit the pipeline in the Advanced dialog of a mapping entry. Operators are added, reordered and removed there.

Operators​

Operators are grouped in the UI the same way as below.

Data Manipulation​

Operators that reshape the value without committing it to a specific Pimcore data type.

OperatorDescription
TrimRemoves whitespace. Mode selects leading, trailing, or both (default).
String ReplaceReplaces every occurrence of Search with Replace. Applied to each item when the input is an array.
Static TextPrepends or appends Text, selected by Mode. Always add also adds the text to empty values.
CombineJoins an array into a string using Glue.
ExplodeSplits a string into an array using Delimiter. Applied recursively to arrays. Keep sub-arrays preserves the nesting instead of returning one flat array.
Flatten ArrayCollapses a nested array into a single flat array.
Reduce Array Key-Value PairsTurns a flat array ['k1', 'v1', 'k2', 'v2'] into ['k1' => 'v1', 'k2' => 'v2'].
HTML DecodeApplies html_entity_decode.
Conditional ConversionMaps string values onto other string values. Separate multiple pairs with |, for example Original 0|1|2 and Converted some|other|values. An asterisk in Original acts as a wildcard, so 0|* with no value|default converts 0 to no value and everything else to default.
Object FieldReads one attribute from a data object. Set Attribute, and Forward parameter to pass an argument to the getter. Use it after Load Data Object.

Data Types​

Operators that convert the value into a Pimcore data type so it can be assigned to a typed field.

OperatorDescription
BooleanCasts to a boolean.
NumericCasts to a float. Return null if empty returns null for non-numeric input that would cast to 0.0, so 0 stays 0 while abc and an empty value become null.
DateConverts to a date. Format is a PHP date format and defaults to Y-m-d.
As ArrayWraps the value in an array unless it is one already.
As ColorConverts an (R,G,B,A) array or a hex string to a color object.
As CountriesConverts an array of country display names into an array of country codes.
GalleryPacks an image asset or an array of image assets into an image gallery.
Image AdvancedPacks a single asset into an advanced image.
Quantity ValueConverts an array to a quantity value. The first item is the value, the second the unit. See Quantity Value operators.
Quantity Value ArraySame as Quantity Value, for an array of such pairs. Returns an array of quantity values.
Input Quantity ValueConverts an array to an input quantity value. The first item is the value, the second the unit. See Quantity Value operators.
Input Quantity Value ArraySame as Input Quantity Value, for an array of such pairs.
Quantity Value RangeConverts an array to a quantity value range. The first item is the lower bound, the second the upper one, the third the unit. See Quantity Value operators.
As Numeric RangeConverts an array to a numeric range. The first item is the lower bound, the second the upper one. An empty bound stays empty rather than becoming 0, so a half-open range is kept.
As External ImageWraps a URL in an external image. Nothing is downloaded; the field holds the address.
As GeopointExpects an array of latitude and longitude.
As GeoboundsExpects an array of north-east latitude and longitude, followed by south-west latitude and longitude.
As GeopolygonExpects an array of latitude and longitude pairs, one pair per point.
As GeopolylineSame as As Geopolygon.

Quantity Value operators​

The five quantity value operators share these settings:

  • Unit source: where the unit comes from. By Unit ID and By Abbreviation read it from the second item of the input; Static uses the unit chosen under Unit and takes only the value from the input.
    • Quantity Value and Input Quantity Value look the unit up and leave it empty if it is not found. With Static they need a plain value as input, not an array.
    • Quantity Value Array and Input Quantity Value Array look a unit up by abbreviation, but take a unit id as given: an unknown id makes the row fail. With Static each element may be a plain value or an array.
    • Quantity Value Range reads the unit from the third item, because the first two are its bounds, and looks it up as Quantity Value does. With Static it still needs the two bounds as an array.
  • Null if no value: if the value is empty, the operator returns null (for the array variants, null for that element) instead of a quantity value. 0 is not empty.

Without a setting the operators behave as before: Quantity Value reads the unit by id, Input Quantity Value by abbreviation, and the two array variants take the unit id as given.

Load / Import​

Operators that resolve the value into an existing or newly created Pimcore element.

OperatorDescription
Import AssetExpects an http or https URL, downloads it, and stores it as an asset in Parent folder. Other values, such as a path on the server, are never downloaded and yield no asset, unless Use existing finds one. The rejected value is logged as an error whenever a download would have been attempted. The file name is taken from the URL. Use existing reuses an asset of the same name instead of creating a suffixed copy, Overwrite existing replaces its contents. Preg match derives the file name from the capture groups of a regular expression, joined with -.
Load AssetLoads an existing asset. Load strategy selects lookup by path or by id.
Load Data ObjectLoads an existing data object by id, path, or attribute. For attribute lookup, set Class, Attribute name and, for localized attributes, Language. Accept partial match matches substrings, so foo finds an object whose attribute is barfoobar. Load unpublished also matches unpublished objects.

What Operators Should Not Do​

  • Heavy calculations. Exploding a string into an array and computing statistics over it belongs in application code, not in an import. Keep the pipeline light so import performance stays predictable.
  • Write to other data objects. A mapping entry writes to exactly one field of the object being imported. To update a different object, create a second import configuration.