Split node? Sorting


I need to sort payload to specific output. I have tried to use a switch node to do this.
I want to get the whole payload but only if the Array meets the conditions.
If the Array exernal id is ID:19_20181001.... the whole payload will come out at the first output in the switchnode. And if the Array external id is ID:20_20201588... the whole payload will come in output 2

Hope you understand what i trying to explain.

Best Regards Niclas

msg.payload.external_id[0] is a string "ID:19_20181001_142048"

so either convert it to an object or

compare the whole string including the "ID:" portion

msg.payload.external_id[0] == "ID:19_20181001_142048"

What have you tried with the Switch node?

It looks like the property you want to test is msg.payload.external_id[0] - so you'd put that in the property box at the top of the node.

You can then add rules for each of the values you want it to test.

Hi Thank you!!

Seems to work to use property.

I will contniue try if this will work.

Bets Regards Niclas