Switch node and buffer

Hi, I need some advice or direction.
I have a device that has 100 inputs and communicates via UDP.
According to certain parameters in the packet I want to route to a specific output using the switch function. I'm trying to set a condition for a value in a buffer, but I can't find the right shape. If I send the payload as an array and not a buffer, the switch node works.
Where am I making a mistake? Alternatively, how to solve it? I guess I could add a buffer to array conversion before the switch node... but before I do that, I wonder if there is another alternative.



put a debug node after the buffer and see what comes out for msg.payload and msg.payload2
this may clear up what you are looking for

I tried that, of course. It's the same thing that goes through the switch and I didn't find anything new. Array working, buffer not working.

Try payload."0" etc instead of `payload[0]

Bingo, thank you Colin!

If anyone is insterested, then see this post for more information Weird JSONata problem

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