I am using the On Change node to detect a change in a boolean true/false. I am actually looking specifically for a change from false to true (and ignore true to false). For now I am using an On Change node looking for “Any Change” followed up on the True output by a Conditional node to check if the payload is now True.
This works but i was wondering if there is a way to reduce this down to one node (other than a function node)? If the On Change node has a “rising edge” and “falling edge” option that would be ideal - perhaps that a feature suggestion?
Thanks
Paul
Hi @paul_wareham,
I think a Latch Node would be the best option for the use case you described. I set up an example below:
This workflow has two Virtual Buttons containing a true and false (as they are labeled). The configuration of the Latch Node below will route so the Latch takes the true
path only when the value changes from false
to true
.
Per the documentation:
When the latch expression evaluates to true AND the node is not in the latched state, the true
route on the right out of the node is taken.
So, if the boolean value is true
, it will take the right path only if the reset expression (the boolean is false) has occurred prior.
When the boolean is true
:
When the boolean is false
:
When the boolean is true
after being false
:
Thanks so much!
Julia