Stepthrough Start free

n8n Data Mapping Examples: 20 Expressions to Copy

Quick answer

Data mapping in n8n means filling a node's fields with expressions in double curly braces, so each item supplies its own value: {{ $json.Email }} for a sheet column, {{ $json.body.email }} for a webhook form, {{ $json.output.total }} for an AI extractor. This page collects twenty expressions taken from the free Stepthrough n8n lessons, starting with Daily Job Alerts, grouped by where the data comes from.

Last updated

Take the free module →Module 14 of the free n8n Jump Start course, about 10 minutes. No account needed.

n8nExpressionsData mappingCheat sheet

From a Google Sheets row

Sheet columns become fields named after the header.

NeedExpression
A simple column{{ $json.Tech }}
A column with a space{{ $json["Tech Email"] }}
A column with an apostrophe or symbol{{ $json['Next Step'] }}
Two columns in a subject{{ $json.Time }} job: {{ $json.Customer }}
The row number{{ $json.row_number }}

From a webhook or form

Data a website form posts to a webhook sits under body.

NeedExpression
The lead's email{{ $json.body.email }}
The service they picked{{ $json.body.service }}
From a later node{{ $('Webhook').item.json.body.email }}

The speed-to-lead lesson feeds {{ $json.body.service }}, {{ $json.body.budget }} and {{ $json.body.timeline }} into its AI scoring prompt.

From AI nodes

NodeExpression
OpenAI Message a model (text){{ $json.output[0].content[0].text }}
Information Extractor field{{ $json.output.score }}
Information Extractor, later{{ $('Information Extractor').item.json.output.total }}
AI Agent{{ $json.output }}

From an earlier node

$json only sees the previous node. Name the node to reach further back: {{ $('Get row(s) in sheet').item.json.Project }}. n8n Reference a Previous Node explains when you need it.

Dates and times

n8n expressions use Luxon for dates, with lowercase yyyy.

NeedExpression
Today, 2026-10-20 style{{ $now.toFormat('yyyy-MM-dd') }}
A readable date{{ $now.toFormat('cccc, LLLL d') }}
In three days{{ $now.plus({ days: 3 }).toFormat('yyyy-MM-dd') }}
Today only (start of day){{ $today }}

The workflow's timezone setting decides what "now" means; set it first under Settings > Timezone, as the job alerts lesson does.

Defaults and clean-up

NeedExpression
A default when empty{{ $json.Phone ? $json.Phone : 'not given' }}
Lowercase an email{{ $json.Email.toLowerCase() }}
Remove spaces{{ $json.Name.trim() }}
First name only{{ $json.Contact.split(' ')[0] }}

Try it free, step by step

Daily Job Alerts: Email Each Tech Their Jobs from Google Sheets with n8n. Every morning at 7, n8n reads a plumbing company's jobs sheet, skips anything not assigned yet, and emails each job to the tech it's assigned to — customer, address, time and what's wrong. No AI… You do every step yourself in a practice copy of n8n, it checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, and nothing touches your real accounts.

Start the free lesson

Or read the full step-by-step guide

Fixed vs Expression: the one setting to check

A field only fills in values when it's in Expression mode. Hover over the field and click Expression: the braces turn green and a Result line shows the first item's real value. If you skip it, the braces are sent as plain text. The client status and meeting notes lessons both point this out after a real test failed that way.

Typing expressions without typos

  • Drag fields from the INPUT panel instead of typing; n8n writes the expression.
  • Field names are case sensitive: Email is not email.
  • Use the Result line as your check before running.
  • For numbers in an If node, map a plain number like 1240.5, not "$1,240.50". The invoice lesson asks the AI for "a number with no $ sign" for this reason.

Key takeaways

  • Sheet columns are $json.Column; names with spaces need $json["Column Name"].
  • Webhook form data sits under $json.body.
  • AI output lives under output; OpenAI's text is at output[0].content[0].text.
  • Switch fields to Expression and read the Result line before you run.

Frequently asked questions

What is data mapping in n8n?

Data mapping fills a node's fields with values from earlier nodes, using expressions or drag-and-drop, so each item carries its own data through the workflow.

How do I reference a field with a space in n8n?

Use bracket notation with quotes: {{ $json["Tech Email"] }}.

Can I use JavaScript in n8n expressions?

Yes. Expressions accept small JavaScript snippets, such as .toLowerCase(), .split() and a ? : check for defaults.

Where can I practice?

The free n8n Jump Start course. Also read What Is JSON? and n8n Expressions for Beginners.

Free lessons in this post

Plain-English definitions, each with an example from a free lesson.

The full AI glossary

All free prompt templates

Visual guides

The same ideas as quick visual guides: swipe through the slides, or read each one as text.

All visual guides

Keep reading

All blog posts · All free tutorials