This page describes how to use the Trigger Global Variables in the IoT Bridge.
global.values
object.global.set()
.global.values
, changes are not persisted to other triggers. Use global.set()
to change the value of a global variable from a trigger.Global variables can be managed from the management portal by navigating to Triggers
-> Global variables
.
Global variables can be set via the API
POST /api/v1/triggers/globals HTTP/1.0
...
{
"key":"myvariable",
"value": "foobar"
}
Global variables can be queried from the API as well
GET /api/v1/triggers/globals HTTP/1.0
...
Global variables can be changed from a trigger using the global.set()
function.
global.set('myvariable', 'foobar')
Global variables can be accessed by a trigger as well:
global.values.myvariable
The
global.values
object is populated when a trigger begins execution, calls toglobal.set()
update values for future executions, but does NOT change theglobal.values
object in the running trigger, nor will a value change in any other trigger.