n8n LabBeginner
Split a String and Get the First Word in n8n
Personalize an email greeting with the lead's first name only.
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:
{
"full_name": "Sarah Jenkins"
}
$json.full_name.
βοΈ Your expression is executed against test data β any correct solution passes. +10 XP
β Solution & explanation
$json.full_name.split(' ')[0]
Output: Sarah
split(' ') breaks the string at each space into ['Sarah', 'Jenkins'], and [0] picks the first element (arrays start at 0 in JavaScript).π‘ Pro tip: Get the last name with .split(' ').at(-1) β it also works for middle names.