I have a function node comparing to values in my node-red and outputting the greater one. I want it to:
Note: The 2 values are being constantly fed by a serial input. My problem is that it keeps passing into the first function then to the second. I want it to skip the first function node when the requirements are met and go to the second function node directly.
Thank you.
You can set a variable in the flow or global context in the first function node and then you can check that value in a switch node to determine what branch to follow.
------------- ----------- -------------- --------------
| serial |----->| switch |----->| function 1 |---->| function 2 |
------------- | |---| -------------- | --------------
----------- | |
|------------------|