Overview
This node, named "Request Mapper," is designed to transform and map input data items by modifying or setting fields according to user-defined rules. It supports two modes of operation: manual mapping where fields are edited one by one, and JSON-based mapping where fields can be set from a JSON object.
Common scenarios for this node include:
- Reshaping incoming data to match the expected format of downstream nodes or APIs.
- Adding, updating, or removing specific fields in each item.
- Simplifying complex data structures by selecting only relevant fields.
- Preparing data for further processing or integration steps.
For example, you might use this node to rename fields, convert field types, or inject new static or dynamic values into your data before sending it to another service.
Properties
| Name | Meaning |
|---|---|
| Mode | Selects how fields are mapped: - Manual Mapping: Edit item fields individually. - From JSON: Edit item fields using a JSON object. |
| Fields to Set | Defines which fields to add or modify in the output data. Each field has: - Name: The target field name (supports dot notation for nested fields). - Type: The type of the value (String, Number, Boolean, Array, Object). - Value: The actual value to set, matching the selected type. |
| Fields to Include | (Shown when "selected" mode is active) Comma-separated list of field names to include in the output. Only these fields will be kept. |
| Fields to Exclude | (Shown when "except" mode is active) Comma-separated list of field names to exclude from the output. All other fields except these will be kept. |
Output
The node outputs an array of items where each item’s JSON data reflects the applied mappings and transformations. The structure of each output item corresponds to the input item but with modifications as specified by the node's configuration:
- Fields added or updated according to the "Fields to Set" property.
- Optionally filtered fields based on inclusion or exclusion lists.
- Supports nested fields via dot notation.
No binary data output is indicated or handled by this node.
Dependencies
- No external services or API keys are required.
- The node relies on internal n8n utilities for execution and data handling.
- No special environment variables or credentials are needed.
Troubleshooting
- Incorrect field paths: Using invalid dot notation or non-existent nested paths may cause fields not to be set correctly. Verify field names carefully.
- Type mismatches: Ensure that the value provided matches the selected type (e.g., number values should be valid numbers).
- Empty or malformed JSON: When using the JSON mode, invalid JSON syntax in the "objectValue" field can cause errors.
- Field inclusion/exclusion conflicts: Specifying both include and exclude fields simultaneously or incorrect field names may lead to unexpected output.
If errors occur during execution, check the node parameters for correct formatting and valid values.