n8n LabIntermediate

Avoid Errors on Missing Fields with Optional Chaining in n8n

Some leads have no address object, which makes your expression throw 'Cannot read properties of undefined'.

Live Execution Simulator Idle
πŸ“₯
Incoming Data
βš™οΈ
n8n Node
🎯
Next Step
> Ready. Type your expression below and click "Check Answer" to run the node.

Incoming Payload / Data:

{
  "customer": {
    "name": "Omar"
  }
}
$json.customer ?? 'Unknown'

βš™οΈ Your expression is executed against test data β€” any correct solution passes. +20 XP

Related labs