n8n LabIntermediate

Find One Object in an Array with find() in n8n

You have a list of agents and need the email of the agent with id 2 to assign a new lead.

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:

{
  "agents": [
    { "id": 1, "email": "[email protected]" },
    { "id": 2, "email": "[email protected]" }
  ]
}
$json.agents.find(a => ).email

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

Related labs