Best strategy for Switch node?

Using the switch node, I want to provide a list of specific zip codes and say "if msg.example = any of these zip codes, go out pin 1". Is this possible, and if so which strategy is best?

Am I able to say "if msg.example contains (zipcode)"->1 and do that for every zip code having its own output?

Or can I do it in a way that is easier to manage?

You could use a JSONata expression for each output / group of zip codes in the switch node by defining the zip codes inside arrays:

msg.example in ['12345', '54321']
1 Like

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