Data Transform
Description
Section titled “Description”This module transforms a data object by extracting only the fields specified in a mapping schema. It receives a mapschema in JSON string format that defines a mapping object with the fields to extract. It uses lodash.pick to select only the indicated properties from the input object. It is useful when you need to reduce a large object to only the necessary fields, for example to clean a payload before sending it to an external API or to filter sensitive fields.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| mapschema | string | Yes | JSON string containing an object with the mapping property. The mapping keys define the fields to extract from the input object. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "datetime": "2024-01-15T10:30:00", "utc_datetime": "2024-01-15T09:30:00Z" }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "mapschema": "{\"mapping\":{\"datetime\":\"datetime\",\"utc_datetime\":\"utc_datetime\",\"dst_from\":\"dst_from\"}}"}- The
mapschemamust be a valid JSON string, not an object - Only fields whose keys are defined in
mappingare extracted - Fields that don’t exist in the input data are silently omitted
- Does not perform field renaming, only selection (uses mapping keys)
- For renaming fields, use the dataMapper or dataMapping module
Related Nodes
Section titled “Related Nodes”- dataMapper (advanced mapping with expressions and renaming)
- dataMapping (mapping from configuration file)
- dataset (data generation with schema)