Switch Node Sequence Rules

I have imported a flow that uses the Switch Node in a way I want to understand what it does.

I am looking for information on how to use the "Sequence Rules" in the Switch Node. More specifically the "Index Between" rule.

Searching the forum and google has not found an information source on this rule.

Can anyone point me to an information source?

Alan

If you have previously used a split node to split up a message into parts (each of which then has an index) - this rule can be used to switch the messages based on that specified index.

Thanks dceejay. Got it. Alan

From the node help

  1. Sequence rules can be used on message sequences, such as those generated by the Split node

(@dceejay please correct me if I'm wrong),

  • Sequence Rules are based on msg.parts.count and msg.parts.index - if either of them are missing from the msg, those rules will not do anything.
  • The Property option plays no part in the Sequence rules. You can leave that option blank and while it will produce a warning that the node is not properly configured, it will still work
  • HEAD - will return the first thru Nth msgs where N is the value in the head option.
  • INDEX BETWEEN will return the msgs in the sequence based on msg.index - remember the first msg is index 0, the second msg is index 1, etc), between the two values specified
  • TAIL - will return the Nth last msgs in the sequence where N is the value in the tail option. If you set 'Tail' to 1, it will return the lsat msg in the sequence. If you set it to 3, it will return the last three msgs in the sequence.

NOTE: It is possible - with 'check all rules' selected, to get multiple copies of the same message depending on your settings. For example, say you start with a msg.payload of 'this is a test' and you set 'Head' to 1, 'Index between' to 1 and 2 and 'Tail' to 2, you will get 'this', 'is', 'a', 'a', 'test'

1 Like

Thanks zenofmud. Great explanation. Alan

1 Like

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