Help with `change` node and `global` values

Folks, I'm stuck on how to parse/handle variables in the change node.

global variable: Shutdown_temperature set to 75 (number)

I can easily get that value in the change node.

Set msg.payload to global.Shutdown_temperature.


But what if I want Shutdown_temperature - 10?

Adding (or: appending) -10 to the text doesn't work.
Or at time of posting it didn't seem to.

How would I do it without another node? Can it be done?

Do you mean global.Shutdown_temperature - 10 as variable name ? that is not a valid variable name.
Or do you mean you want to calculate global.Shutdown_temperature-10 ? JSONata can do that.

(Yeah, ok my bad.)

I want to get the latter.

global.Shutdown_temperature - 10.

Could you please show me how?

In the change node, set msg.payload to:

This assumes that Shutdown_temperature is a number.


Putting aside I (again) goofed with the name. Quickly and easily fixed.

For another reason, it doesn't seem to want to play the game.

This is the flow:


This is the screen I see:


Pressing the inject node..... Nothing comes out.

I'm an idiot!

I had the field set to {} instead of J: Too used to using the {} option.

1 Like