In 2026, the power of n8n lies in its ability to manipulate data between nodes using JavaScript expressions. This lesson teaches you how to transform raw JSON payloads into clean, actionable variables for your growth engine.
n8n uses a template-string-like syntax to access data from previous nodes.
{{ $node["NodeName"].json["field_name"] }}{{ $node["NodeName"].parameter["param_name"] }}Common data transformations you will use:
// 1. Normalize a phone number to E.164 format
{{ $json.phone.replace(/[^0-9]/g, '').replace(/^0/, '+92') }}
// 2. Conditional text based on lead score
{{ $json.score > 8 ? "Priority Lead" : "Standard Lead" }}
// 3. Extracting the domain from an email
{{ $json.email.split('@')[1] }}
n8n distinguishes between JSON data (text/numbers) and Binary data (files/images). When mapping an AI-generated report to an email node, you must ensure you are referencing the json key, not the binary output.
" taqi NAQVI ").Create a workflow that takes a "Deal Size" and a "Closing Probability" (0-1). Use a JS expression to calculate the "Expected Value" and format it as a currency string (e.g., "$5,000").