Storing Previous Value of msg.payload

Hi All
I am updating the message payload with an interval and at a certain condition, I am stopping the updating by giving ON as String to that function .So, I need the Previous Value that is the previous msg payload. Can anyone know it please share your valuable info.

You can store the value in the function node's context so that it will be available the next time into the function. See the node red docs on Writing Functions where it is described. In particular you will want to use the functions context.set() and context.get()

Thank you Sir,
Can I have an example Flow..?

Have you read and understood the docs?

A quick Google found this which looks as if it might be helpful.
http://www.steves-internet-guide.com/node-red-variables/

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.