Map
Normalize and enrich records
Map
Normalize and enrich records
yaml
type: io.kestra.plugin.transform.MapExamples
yaml
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
yaml
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
yaml
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
yaml
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
Definitions
io.kestra.plugin.transform.Map-FieldDefinition
exprstring
optionalboolean
Default
falsetypestring
Possible Values
STRINGINTFLOATDECIMALBOOLEANTIMESTAMPLISTSTRUCTfrom *Requiredobject
dropNulls booleanstring
Default
truekeepOriginalFields booleanstring
Default
falseonError string
Default
FAILPossible Values
FAILSKIPNULLoutputFormat string
Default
TEXTPossible Values
TEXTBINARYoutputType string
Default
AUTOPossible Values
AUTORECORDSSTORE