Data Mapping
Description
Section titled “Description”This module transforms an input data object by applying a field-to-field correspondence map defined in a JSON configuration file. It reads the mapping file from the project’s config/ folder, where each mapping key represents the output field name and the value represents the input field name. It is a simple and declarative way to rename and reorganize fields of an object. Useful for adapting data between different API formats or normalizing data structures.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| mappingFile | string | Yes | Name of the mapping JSON file located in the config/ folder. Example: order_mapping.json |
| mapschema | string | No | Alternative mapping schema (internal use). |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "nombre": "Juan Perez", "correo": "juan@email.com", "telefono": "123456789" }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "mappingFile": "contacto_mapping.json"}Where config/contacto_mapping.json contains:
{ "nombre": "full_name", "correo": "email", "telefono": "phone"}- The mapping file must be in the project’s
config/folder - If a mapping field does not exist in the input data,
nullis assigned - It is a unidirectional and flat mapping (does not support nested structures)
- For more complex transformations with expressions, use the dataMapper module
Related Nodes
Section titled “Related Nodes”- dataMapper (advanced mapping with expressions)
- dataTransform (transformation with schema)
- dataset (dataset generation)