Remove manuel line break from string for msg.payload and switch

You can use a function node to trim the payload before the switch

msg.payload = msg.payload.trim();
return msg;

or use JSONata in the switch property

$trim($$.payload)

2 Likes