Separate letters and add a hyphen

You could add a function node after the form node as follows -

let txt = msg.payload.codigo
txt = txt.slice(0, 3) + "-" + txt.slice(3);
msg.payload.codigo=txt
return msg;
1 Like