Skip to content

Mapping

The Mapping node transforms each row by evaluating an expression. Use it to reshape data, rename fields, compute derived values, or convert between data structures.

Configuration

PropertyTypeDefaultDescription
expressionstring--Required. An expression evaluated per row. The row variable refers to the current row.

Input

Accepts:

  • An array of rows -- the expression is evaluated once per row.
  • A single object (associative array) -- the expression is evaluated once on the whole object.

Output

The output depends on what the expression returns:

  • If the expression returns an array/object, that becomes the new row.
  • If the expression returns a scalar, the original row is preserved with the result added as _mapped.

Expression Context

VariableDescription
rowThe current row being processed
inputSame as row (for single-object input)

Using remap() for Field Renaming

The remap() function is the most common way to restructure rows:

remap(row, '{"title": "post_title", "body": "post_content", "author": "post_author"}')

This creates new rows with title, body, and author fields, pulled from the original post_title, post_content, and post_author fields.

Example Expressions

Rename fields from a WordPress post query

remap(row, '{"title": "post_title", "content": "post_content", "date": "post_date"}')

Extract a nested value

row.address.city

Compute a derived value

row.price * row.quantity

This returns a scalar, so each row gets the result as _mapped.

Return a modified copy of the row

To add a field while keeping existing ones, use Set Field instead. Mapping replaces the entire row unless the expression returns the full row with modifications.

Example Use Cases

Normalize API response to app schema

An external API returns {"first_name": "...", "last_name": "...", "email_address": "..."} but your app expects {"name": "...", "email": "..."}:

remap(row, '{"name": "first_name", "email": "email_address"}')

Transform Combine output

After a Combine node merges two data sources:

row.products

This extracts just the products array from the combined object.

TIP

For adding or modifying a single field without replacing the entire row, use the Set Field node instead.