In this lecture, I will show you how to use a switch note, and as you'll see, it's very simple.
You can find a switch note under function.
So the way that this switch note works is very simple.
It's like an if statement in a regular programming language.
So in the switch node properties window, you can set any number of properties and for each property
you set a condition and then depending on which condition is true, appropriate output will be sent
out.
So in this case, I've got two conditions.
The first one is for any number that comes in through the payload, a message payload that is larger
than five.
And the second condition is true.
If the number that comes through the message payload is less than or equal to five.
And of course, you have all sorts of other conditions or rules that you can you can use in your properties.
It can also set the switch node to continue checking all rules.
Or if you set it to all rules, then output will be triggered for any rule that is true, or you can
get it to stop after the first match is found.
So then I'll be just typing in a different number in my message payload to see how the switch node behaves.
So let's deploy that and have a look at the debug window.
And I'm looking at the current flow only.
And right now the the trigger will send out a payload with the number six to the switch node.
So it's trigger that.
And you can see that this node was activated, this debug node diagnosed with name larger than five
or greater than five.
And the number that came through is six.
OK, this did Pagnol just just print out the payload and this is its name.
I'm going to change the payload to three.
Redeploy to make the change effective, trigger it, and you could say now that we've got a threat coming
through because of this debug node was activated, which is less than or equal to five.
So you can use this switch node to implement conditional logic in your in your flows, as you would
using an if statement or a switch structure in a regular programming language.