How mapping works
- Field mappings —
{ "source_field": "target_key" }pairs copy values from answers to the output. - Transformations — optional per-source transform applied before the value is written.
- Static values — constants merged into the output (campaign IDs, record types, tags).
- Unmapped fields — optionally include remaining answers under a prefix.
address.city). Targets use dot notation for nested output (contact.address.city).
Built-in transforms
Chain transforms with
| (e.g. trim|lowercase).
Register custom transforms:
Conditions
Optionalconditions on FieldMapping:
- Global (no
source): if any fail, onlystaticValuesare returned. - Per-source (
sourcematches a mapped field): skip that row when the condition fails.
filled, empty, equals, not_equals, truthy, falsy.
FieldMapping DTO
FieldMapper::map example
Nested paths
Arr::get / Arr::set power both sides — deep paths work out of the box.
Static values
Static values are written after field mappings and can define nested keys:Preview
Use the same mapper for admin previews and tests:preview() is an alias of map() — pass the form schema when a transform needs block metadata from $context['schema'].
Conditional feeds in Studio can attach mapping per branch. See Conditional feeds.