Data Mapper in HTTP Actions
An HTTP action’s request body can be a data mapper instead of fixed JSON. Use one when the body has lists, nested objects, computed fields or fields that appear only sometimes. In a data mapper, refer to the HTTP action’s input arguments by name, such as title, and use DSL expressions for string handling, type conversion and computed values.
Build the request body with a data mapper
- Open the HTTP action and select the Body tab.
- Select Data Mapper.
- In Body Mapping, write one line per JSON field: the field name, a colon, then the input argument or expression that fills it.
The mapping in the screenshot sends three fields. Each value is the name of one of the action’s input arguments:
- Select Test to send the request, then check the result in the Response tab.
Data Mapper or raw JSON?
The other body option, Raw JSON, is fixed JSON with Mustache placeholders such as {{user_email}}.
The same simple body in each format:
Raw JSON example
Data Mapper example
Both produce the same output for simple cases. Data Mapper is useful when you need array manipulation or conditional logic.
Build complex payloads
Create a list of objects
Scenario: Send a bulk update request with multiple items.
Input Data:
Data Mapper:
Output:
Conditional fields
Scenario: Include a field only when a condition is met.
Input Data:
Data Mapper:
Output:
Flatten nested data
Scenario: Extract values from a nested API response.
Input Data (ServiceNow-style):
Data Mapper:
Output:
Filter and transform arrays
Scenario: Send only high-priority items to an API.
Input Data:
Data Mapper:
Output:
Build a request from a 2D array
Scenario: Transform a Snowflake/SQL response into structured JSON.
Input Data:
Data Mapper:
Output:
Keys with spaces or special characters
Scenario: Create a page in a Notion database whose property names contain spaces and &, such as Assignment Group and Files & media.
Data Mapper reads every key as a path, so a key with a space, hyphen, & or other punctuation fails to evaluate. Wrap that kind of key in $["..."] to use it as literal text. Plain keys such as Title and Source don’t need it. For the full rules, see Keys with spaces or special characters in the Data Mapper reference.
Input Data:
Data Mapper:
The CONDITIONAL() adds the Files & media property only when the request includes file uploads, and MERGE() combines it with the other properties.
Output:
Common operators
String functions
Apply directly to field values:
Troubleshooting
Tip: Test with hardcoded values first, then add Data Mapper transformations one at a time.
Syntax errors
Data Mapper uses YAML. Watch for:
- Indentation: Use consistent spaces (not tabs)
- Quotes: String literals need single quotes inside:
"'literal string'" - Colons in values: Wrap in quotes if value contains
: - Keys with spaces or special characters: Wrap the key in
$["..."], for example$["Assignment Group"]. See Example 6.
Wrong:
Correct:
Empty arrays
If MAP() or FILTER() returns empty, check:
- The
itemspath is correct - Input data actually contains the expected array
- Filter condition isn’t too restrictive
Debugging
- Test your API with hardcoded values first
- Add one Data Mapper transformation at a time
- Check the Response tab to see actual output
Migrate a Raw JSON body to Data Mapper
Key difference: Data Mapper preserves types. Arrays stay as arrays, numbers stay as numbers. No need for $STRINGIFY_JSON() workarounds.