Data Mapper Node
Transform and reshape data using a JSON output template.
Overview
The Data Mapper node (labeled "Inspector" in the configuration panel) lets you define a JSON template that transforms data from previous nodes into a new structure. Use {{variableName}} interpolation to inject dynamic values.
Configuration
| Field | Description | Required |
|---|---|---|
Output Template |
JSON template defining the output structure | Yes |
Output Variable |
Variable name to store the mapped data | Yes |
Output Template
The template editor supports the Insert Variable button to reference values from preceding nodes. Define your desired JSON structure and use {{variableName}} syntax to inject dynamic values.
Example: Reshape API Response
{
"user": {
"fullName": "{{api_response.first_name}} {{api_response.last_name}}",
"email": "{{api_response.email}}"
},
"metadata": {
"source": "api",
"timestamp": "{{current_time}}"
}
}
Example: Combine Multiple Sources
{
"report": {
"title": "{{form_input.title}}",
"data": "{{query_results}}",
"generatedBy": "{{model_response}}",
"status": "complete"
}
}
Example: Flatten Nested Data
{
"id": "{{response.data.user.id}}",
"name": "{{response.data.user.profile.name}}",
"role": "{{response.data.user.role}}"
}
Best Practices
- Use descriptive variable names in your output template
- Keep templates focused on the data needed by downstream nodes
- Use the Insert Variable button to avoid typos in variable references
- Test with sample data to verify the output structure