Store Context


The Store Context node stores the specified data using key-value pairs within the specified scope, which can be retrieved using the Read Context node.

Node Type

Action.

Input and Output Ability

This node has multiple entry points and multiple exit points. If the input msg contains custom expressions, both the input and output must be JSON. For more information on expressions, see Expressions.

Node Properties

../../_images/store_context.png


Name

The name for this node.


Scope

The scope of where the data is stored. Available options are as per the below.

  • Flow: Data stored can only be accessed within the same flow where this node belongs.
  • Global: Data stored can be accessed by all flows within the same OU.


TTL (s)

The time the data is stored for in seconds. The max TTL is 864000 seconds. Once the specified time has elapsed, the data can no longer be retrieved.


Key and Value

The data to be stored represented by key-value pairs. The max number of key-value pairs is 20. The Key is unique and the Vaule is repeatable. The data of both Key and Value will be stored with a String data type by default, unless expressions such as ${msg.id} are used.


Accumulate

If the key has been stored before, and both the stored value and the new value are numbers, check this checkbox to accumulate the new value and the stored value. The last stored value is the sum of the new value and the stored value. If unchecked, the stored value will be overwritten and the last stored value is the new value only.


For example, the key-value pair that was stored last time is k-1, wherek is the key and 1 was the stored value. If a new value for k is entered, for example k-2, checking the box will add the new value (2) to the stored value (1) as both values are numbers and the new stored key-value pair is k-3. If unchecked, the stored value will be overwritten and the last stored value is k-2.


If either the stored value or the new value is not a number, the checkbox is considered invalid and the stored value will be overwritten.


You can add more or delete key-value pairs by clicking + Add or the Delete icon respectively.


Description

The description for this node.


Limitations

  • Maximum node entry points: 100
  • Maximum TTL: 864000s
  • Maximum key-value pairs: 20


Samples

Input Sample

{
   "device_id_no":"device001",
   "time":"1614420000000",
   "measurepoints": {
      "converter001":"200"
    }
}


Output Sample

The output message will be the same as the input message.