n8n LabBeginner
Count Characters with length in n8n
SMS messages over 160 characters cost double. Check the message length before sending.
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:
{
"message": "Your order has shipped!"
}
$json.message.
βοΈ Your expression is executed against test data β any correct solution passes. +10 XP
β Solution & explanation
$json.message.length
Output: 23
length is a property on strings and arrays, so it has no parentheses. Writing length() throws an error.π‘ Pro tip: Use it in an IF node: {{ $json.message.length > 160 }}.