[Solved] "On Change" Logic


#1

I am trying to use the On Change logic to make a determination if a value has toggled between 1 or 0. I am using two nodes one for an “Increase of at least” and another for “Decrease of at least”. I do not seem to be able to make this work using 1 as the value (or even 0.5) to catch the change from 1 to 0 or back.

It seems as if I have a 0 for any of the comparators (for example 0 to 1 or 0 to 2) the calculation does not work. The same applies for the opposite 1 to 0 or even 2 to 0.

My workflow does work if I compare something like 1 to 2 or 2 to 1.

Am I doing something wrong or does the On Change not work for a comparison with 0?


#2

It looks like I can reproduce this as well. Our team is looking into it now. Thanks for the report!


#3

Ok thanks. For now I am “mutating” any 0’s to 0.1 and the workflow works
properly.


#4

We have identified and fixed the issue. You should now be able to use the node as expected. Thanks again for reporting it!


#5

Thanks Brandon! Verified it is resolved. No more mutating…


#6

Bump… " am trying to use the On Change logic to make a determination if a value has toggled between 1 or 0. I am using two nodes one for an “Increase of at least” and another for “Decrease of at least”. I do not seem to be able to make this work using 1 as the value … "

I have an identical setup. Both On Change nodes are reporting “TypeError this.compareFunc is not a function”.

They are error free if Any Change is selected.

?


#7

Thanks for the bug report! We were able to reproduce your issue, and just rolled out a hot-fix, so the node should be working appropriately for you now.

Also, depending on what exactly you are attempting to do, I might suggest checking out the Latch node as well - it might work well for your use case.


#8

Impressive response time!

Thanks and I will check out Latch.