I am looking for a way to route some messages based on a property, lets say the topic. Using a switch node i can route the message. For example 'Foo' could be routed to output one and 'Bar' could be routed to output two.
What if if wanted to route both 'Foo' or 'Bar' to output one and only 'FooBar' to output two. Does anyone have any suggestions on the best way to do this.
You could either route Foo and Bar to output one and two and FooBar to three and then join outputs 1 and 2 together. Alternatively use a regex test to check for Foo or Bar. Include start and end of string in the regex to make sure it doesn't find any string containing Foo and other stuff. So something like ^(Foo|Bar)$
[Edit] I guess that a regex will be more efficient than JSONata