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