Dear all,
I'm trying to solve thi issue but also searching in other forum Topic, I'm not able to solve:
I have a simple JSON String from a simple HTTP Request node with "GET:"
I just want to extract the "final_balance" value, but I'm not able!
Can someone help me?
PS: After this, I just want to compare the new value with the previous value, (that I have to save in some way?) and get an alarm if the value is changed!
Thanks in advance.
To compare current to previous value, you need to store the current value in a global/flow variable. Before storing the current value, you need to compare the current value with the variable - noting that the first time you do that, you won't have a variable because you haven't stored it yet. To get round that, you can store a dummy value to it on Node-RED startup (using the inject node). Though if you are using a function node to do the comparison, you can simply provide a default dummy value.
You can use a Filter node for that. Set it to test msg.payload.IJFVIUEHIUVHEURGUERGIUEWRG.final_balance and only pass on a value if it has changed, or if it has changed by a particular amount if that is what is required.