Skip to main content

Data Transform

Transform in flight, not in a pipeline. Real-time field transformations applied at the data boundary. No ETL pipelines or data duplication required.
Data Transform shares the same field path rules as Data Control. See Field Targeting for nested paths, arrays, and required behavior.
You’ll see fields written two ways in our examples — both are valid YAML and produce identical results:
For a complete Virtual API Configuration, start with version: "0.3" and define controls under objects.<objectName>.controls. Snippets below that start with controls: are fragments meant to live inside an object definition.

Operations

Combine

Merge two or more string fields into a single new field.
Input:
Output:

Coalesce

Select the first non-empty value from two or more fields. Ideal for fallback logic and data normalization.
Input:
Output:

Delete

Remove one or more fields entirely from the outbound payload. Use this when you do not want consumers to see that a field exists at all.
Input:
Output:

Execution Rules

  • Controls execute top-to-bottom. A later control can use a field created by an earlier control.
  • fields order matters for both combine and coalesce.
  • combine only operates on string source fields.
  • All fields and into must share the same parent path when you use nested paths. For example, address.city, address.state, and address.location are valid together.
  • delete does not use into. It removes the fields named in fields directly.
  • into must point to a new field. If the target field already exists, the transform fails instead of overwriting it.
  • Set required: true when missing inputs should fail the request. That check is full-path strict: if any parent segment or leaf target is missing, the request fails instead of silently skipping the control. For coalesce, missing, null, and empty-string values are treated as empty, but whitespace-only strings, 0, and false still count as present values.
  • remove_source: true works for both combine and coalesce. Use delete when you want an explicit cleanup step later in the control pipeline.
  • If the matched payload is an array, the full control pipeline runs against each matching object element in order. Non-object elements are skipped.
  • Array execution is not transactional across elements. If an earlier element has already been transformed and a later element fails a required check, the request still fails, but the earlier successful element changes are not rolled back.

Nested Paths

Use nested paths when all source fields and the destination share the same parent:

Combining with privacy controls

Controls execute top-to-bottom. If a filter control (like hash or redact) runs before a transform that references the same field, the transform will see the already-modified value. Place transforms before filters when both operate on the same fields.
Apply transformations before or after privacy controls:

Removing original fields

Optionally remove source fields after transformation. This works on both combine and coalesce:
Output:
If you prefer to keep the cleanup as a separate ordered step, use delete after the transform:
Use delete when the field should disappear completely. Use redact when the field should remain present but its value should be blanked or masked.

Next steps

Field Targeting

Learn how transform paths work with nested objects and arrays

Data Control

Redaction, tokenization, anonymization

Control Block Reference

Detailed transform options and execution rules