Address multiple Outputs in a function node by name

Hello,

I am currently using function nodes with multiple outputs. I know how to address them in the return statement, but I would like to address outputs defined directly with node.send() either via their index or, if assigned, via their name. Is there a way to do this?

Steffen

Not explicitly, but you can do something like:


function sendToOutput(index, msg) {
   // Update '10' for how many outputs you have
   const result = new Array(10)
   result[index] = msg
   node.send(result)
}

sendToOutput(3, msg)
2 Likes

Ok, build an array and adress the elements inside this array, yep, that seems possible. Not exactly what I want but always a good start.

Wouldn’t be node.output(‚out1‘).send() or node.output[5].send() an issue for featured functions?

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