Data Transformation in n8n

From the n8n cheat sheet ยท Expression Syntax ยท verified Jul 2026

Data Transformation

String, array, and object manipulation in expressions

javascript
# String Methods
{{ $json.email.toLowerCase() }}
{{ $json.name.trim() }}
{{ $json.text.replace('old', 'new') }}

# Array Methods
{{ $json.tags.join(', ') }}
{{ $json.items.length }}
{{ $json.prices.map(p => p * 1.1) }}

# JMESPath Queries
{{ $json.jmespath('users[0].email') }}
{{ $json.jmespath('users[*].email') }}
{{ $json.jmespath('users[?age > \`18\`].name') }}
๐Ÿ’ก JMESPath is powerful for complex JSON queries
โšก Use || for fallback values when field might be empty
๐Ÿ“Œ Ternary operator works: condition ? true : false
๐Ÿ” .map(), .filter(), .reduce() work on arrays

More n8n tasks

Back to the full n8n cheat sheet