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)
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)