Data Set
Description
Section titled “Description”This module generates a new data object from a configurable schema that allows using dynamic expressions. The schema defines the structure of the output object, where each field can have a static value or a JavaScript expression enclosed in {{...}} that is evaluated with access to the input data. It supports both simple objects and data arrays, including nested subarrays with decorators. It uses lodash for advanced functions within expressions. It is ideal for building custom payloads, transforming complex data structures and preparing data for external APIs.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| mapschema | string/object | Yes | JSON schema that defines the output dataset structure. Can be a JSON string or an object. Values can be static or dynamic expressions with {{...}}. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "id": 123, "priceWithTax": 60.5, "detail": [ { "productName": "PRODUCTO A", "totalPrice": 100 } ] }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "mapschema": { "id": "{{data.id}}", "priceWithTax": "{{price * 1.21}}", "uppercaseValue": "{{_.toUpper(data.value)}}", "detail": [ { "productName": "{{_.toUpper(item.productName)}}", "totalPrice": "{{item.price * item.quantity}}" } ] }}- Dynamic expressions are defined between double braces:
{{expression}} - Within expressions you can access
data(input data) and_(lodash) - For nested arrays,
itemis used to refer to the current iteration element - If an expression fails, the field is assigned as
nulland the error is logged - The schema can be a JSON string (automatically parsed) or an object
- Uses the
convertSchemaToArrayToObjectfunction to normalize the schema - If all fields are processed without errors, it continues to the next module
Related Nodes
Section titled “Related Nodes”- dataMapper (mapping with field rules)
- dataTransform (transformation with filter schema)
- dataMapping (mapping from configuration file)