Skip to content

Data Mapping

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.

ParameterTypeRequiredDescription
mappingFilestringYesName of the mapping JSON file located in the config/ folder. Example: order_mapping.json
mapschemastringNoAlternative mapping schema (internal use).
{
"nextModule": "siguiente_modulo",
"data": {
"nombre": "Juan Perez",
"correo": "juan@email.com",
"telefono": "123456789"
}
}
{
"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, null is assigned
  • It is a unidirectional and flat mapping (does not support nested structures)
  • For more complex transformations with expressions, use the dataMapper module
  • dataMapper (advanced mapping with expressions)
  • dataTransform (transformation with schema)
  • dataset (dataset generation)