
Transform Map
CertifiedNormalize and enrich records
Transform Map
Normalize and enrich records
Reshape records by selecting fields, casting types, and deriving new typed values from expressions without scripts.
type: io.kestra.plugin.transform.MapExamples
Normalize records
id: map_normalize_records
namespace: company.team
tasks:
- id: fetch
type: io.kestra.plugin.core.output.OutputValues
values:
records:
- user:
id: c1
createdAt: "2026-01-01T00:00:00Z"
items:
- price: 10.5
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.fetch.values.records }}"
fields:
customer_id:
expr: user.id
type: STRING
created_at:
expr: createdAt
type: TIMESTAMP
total:
expr: sum(items[].price)
type: DECIMAL
dropNulls: true
onError: SKIP
Map DuckDB stored results
id: map_duckdb_stored
namespace: company.team
tasks:
- id: query1
type: io.kestra.plugin.jdbc.duckdb.Query
sql: SELECT now() as "ts";
fetchType: STORE
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.query1.uri }}"
outputType: RECORDS
fields:
ts:
expr: ts
type: TIMESTAMP
Map direct output values
id: map_direct_outputs
namespace: company.team
tasks:
- id: query1
type: io.kestra.plugin.jdbc.duckdb.Query
sql: SELECT 1 as "value" UNION ALL SELECT 2 as "value";
fetchType: FETCH
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.query1.records }}"
fields:
value:
expr: value
type: INT
Download JSON and transform
id: map_http_download
namespace: company.team
tasks:
- id: download
type: io.kestra.plugin.core.http.Download
uri: https://dummyjson.com/products
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.download.uri }}"
outputType: RECORDS
fields:
first_title:
expr: products[0].title
type: STRING
Properties
fields *Requiredobject
Fields
Output field definitions keyed by target field name. Each value can be a shorthand expression string or an object with expr, optional type, and optional.
io.kestra.plugin.transform.Map-FieldDefinition
Expression
Per-record expression used to compute the output field value.
falseOptional
When true, allows the field to be absent from the input record. A field that is present with a null value is always allowed and maps to null, whatever this is set to. Expression and cast errors are still handled by onError.
STRINGINTFLOATDECIMALBOOLEANTIMESTAMPLISTSTRUCTOutput type
Optional type to cast the evaluated value to before writing the output field.
from *Requiredobject
Input records
Ion list or struct to transform, or a storage URI pointing to an Ion file.
dropNulls booleanstring
trueDrop null fields
Omits output fields whose final value is null after mapping.
keepOriginalFields booleanstring
falseKeep original fields
Keeps input fields not explicitly mapped. If you map a_new: a, the original a is still kept.
onError string
FAILFAILSKIPNULLOn error behavior
FAIL stops the task on the first field error, SKIP drops the current record, and NULL writes null for failing fields.
outputFormat string
TEXTTEXTBINARYOutput format
Experimental: TEXT or BINARY. Only transform tasks can read binary Ion. Use TEXT as the final step.
outputType string
AUTOAUTORECORDSSTOREOutput type
AUTO stores to internal storage when the input is a storage URI; otherwise it returns records.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
records array
Transformed records
JSON-safe records when output mode is RECORDS or AUTO resolves to RECORDS.
uri string
Stored Ion file URI
URI to the stored Ion file when output mode is STORE or AUTO resolves to STORE.