I want to save a value in a flow once and then compare it to future message payload field in a function block.
I have saved the value I want to compare in a flow named color:
colora = flow.get(“color”)
now I want to compare that value in color it to a field in an if statement
if (msg.payload.id == colora)
{msg.payload.new= “blue”}
else {msg.payload.new=“white”}
my problem is that it never detects when msg.payload.id actually matches the value in the flow.color field so everthing is “white”.