SPLIT node - help

Though I am open to alternate nodes to do this.

(Actually I am now thinking this is not the right node for this job, but.....)

I have a message payload (example) 123

I want to split it into 3 messages: 1 2 and 3.

I'm not up on node-red's asynchronous operations, but it may not be needed.

Oh, Specifications for the function:
3 digits. Numbers.
Must be 3 numbers long.
Leading 0 must be sent. (Kinda given if 3 digits)
A nominal delay between messages being sent out.

With function node maybe like this

let digits = msg.payload.toString().split('');
let realDigits = digits.map(Number)

function sendOut(digit){


And then add delay node after function node and adjust the delay between messages as needed.

1 Like

I'm happy with that.

I was messing around with:

var y = 0;
var z = 0;
var x = msg.payload;

y = parseInt(x / 100);
msg.payload = y;
x = x - (y * 100);

msg.payload = x


msg.payload = "test";

return msg;

Yeah, the test isn't needed, but just to see progress.

So I was:
int(/100) -- send result
int(/10) -- send result
send last digit.

But yours seems nicer.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.