Skip to main content
Version: Next

Data Target

The data target assigns the result of the transformation pipeline to a data object field. Which fields are selectable depends on the result type the pipeline produces: a pipeline returning a date cannot be assigned to a text field.

Four data target types are available.

Data target typesData target typesData target types

Direct​

Assigns the value to a field of the data object class, to a localized field, or to an object brick field.

Object brick fields are addressed as <OBJECT_BRICK_FIELD>.<OBJECT_BRICK_TYPE>.<ATTRIBUTE>. The object key is addressed as key.

The parent folder of the object can be set with the path field (SYSTEM Path), so the location can be composed from the import data with the transformation pipeline. The folder structure is created if it does not exist yet. Folders are created while the mapping is applied, not when the object is saved: if a later mapping of the same row fails or the object is not saved, the created (empty) folders remain.

The mapping is applied after the resolver has loaded or created the object, so the path from the mapping takes precedence over the Element Creation and Element Location Update strategies. Keep a normal Element Creation strategy (for example Static Path) as a fallback: it places new objects whose path value is empty. For Element Location Update, No Change avoids moving the object twice. The parent of an existing variant cannot be changed; such rows fail with an error.

For path, Write If Target Is Not Empty behaves differently from other fields, because a new object already has a parent when the mapping runs. Here the setting means "the object already exists":

  • enabled: the path is applied to new and to existing objects (existing objects are moved).
  • disabled: the path is applied only to newly created objects; existing objects keep their location. This does not protect the placement of new objects: to keep a new object where the Element Creation strategy put it, leave the path value empty.

Data Target DirectData Target DirectData Target Direct

Configuration options

  • Field Name: the target field.
  • Language: for localized fields, the language to write.
  • Write If Target Is Not Empty: enabled by default. Disable it to keep an existing value.
  • Write If Source Is Empty: enabled by default. Disable it to prevent an empty source value from clearing the field.

Many-to-Many Relation​

Assigns related elements to a relation field. Supported field types are manyToManyRelation, manyToManyObjectRelation, advancedManyToManyRelation and advancedManyToManyObjectRelation. Assigning to any other field type fails with a configuration error.

The transformation pipeline has to produce a result type of advancedDataObjectArray, dataObjectArray, assetArray or advancedAssetArray, typically by ending in a Load Data Object or Load Asset operator.

Configuration options

  • Field Name, Language, Write If Target Is Not Empty, Write If Source Is Empty: as for Direct.
  • Overwrite Mode:
    • Replace (default): the imported relations replace the current ones.
    • Merge: the imported relations are added to the current ones. Existing relations are kept, including relations to unpublished elements.

Classification Store​

Assigns the value to one key of a classification store field.

Data Target Classification StoreData Target Classification StoreData Target Classification Store

Configuration options

  • Field Name: the classification store field.
  • Classification Store Key: the group and key to write, saved as <GROUP_IDENTIFIER>:<KEY_IDENTIFIER>. The integer form <GROUP_ID>-<KEY_ID> of older entries is still read, and is saved for a group or key that has no identifier. The keys offered are those whose type the pipeline's result type can fill, exactly as for a class attribute, plus keys of the multiValue type over such a type. A result type no key type can hold offers no key at all — the three array result types the Classification Store Batch target takes (quantityValueArray, inputQuantityValueArray, dateArray) are of that kind, because a single key holds one value and not a list of them. Keys of the two advanced relation types are offered for assetArray and dataObjectArray only when the listing is asked for the advanced relations, and their values are written as relation metadata with no columns filled, as for a class attribute written through Many-to-Many Relation.
  • Variant: shown when the selected key declares variants. The variant is part of the reference, <GROUP_IDENTIFIER>:<KEY_IDENTIFIER>#<VARIANT>, so one mapping entry per variant writes the variants of one key side by side. Without one, the default variant is written. Variants are written by this target only, not by Classification Store Batch.
  • Language: shown once a key is selected and the key is localized. The key's own flag decides; a key that states none uses the flag of the classification store field. For any other key the value is written without a language.
  • Write If Source Is Empty: enabled by default. Disable it to prevent an empty source value from clearing the key. The setting only takes effect once it has been saved for the mapping entry at least once — see When the setting takes effect.

Classification Store Batch​

Assigns many classification store keys with a single mapping entry. The transformation pipeline has to produce an array keyed by <GROUP_IDENTIFIER>:<KEY_IDENTIFIER> or the integer form <GROUP_ID>-<KEY_ID>, with the values to assign. A key that declares variants is refused by name, and a key whose value the entry cannot build is warned about and skipped.

The result type must be array, quantityValueArray, inputQuantityValueArray or dateArray.

Configuration options

  • Field Name: the classification store field.
  • Language: shown when the field is localized or any key of its store is. The language applies to the keys of the entry that are localized, decided per key as for Classification Store; the other keys are written without a language.
  • Write If Source Is Empty: disabled by default, unlike every other data target. Enable it to let an empty source value clear the key instead of being dropped. The setting only takes effect once it has been saved for the mapping entry at least once — see When the setting takes effect.

Data Target Classification Store BatchData Target Classification Store BatchData Target Classification Store Batch

For the required data shape and worked examples, see Classification Store Batch Details.

Keys Declaring Variants​

On both classification store targets a key of type multiValue holds one value per variant. The import writes the addressed variant of the addressed language, replacing the value already held there. A JSON array in the source field is not a list: it is stored as the key's one value, as it is for any other key.

If the engine of the store cannot hold a variant, the key is written to the default variant and a warning in the import log names the key and says that the engine of the store has to be changed.

When Write If Source Is Empty Takes Effect​

On the two classification store targets the setting is only in force on a mapping entry for which it has been decided, which the editor records the first time the control is changed or the target type is selected. Until then the entry keeps the behaviour it had before the setting reached these targets, whatever its stored value says: the Classification Store target writes every value including empty ones, and Classification Store Batch drops every empty value before writing and does not activate the group of an entry whose values are all empty. Two entries with identical-looking settings therefore import differently depending on whether that decision has been recorded.

Open the mapping entry, set the control to what the import should do and save the configuration to put it in force.

A value counts as empty when PHP counts it as empty: null, false, 0, 0.0, "0", "" and []. Note that 0 is among them.