Skip to main content

Context

Context is a special global data-type. Its structure is same as the JSON input received on the node.

It uses the membership operator . to access its members.

Example‚Äč

If following is received on the input:

{
"customer": {
"firstName": "John",
"lastName": "Doe",
"groups": ["admin", "user"],
"age": 34
}
}

We would be able to use the following properties globally:

customer.firstName; // "John"
customer.lastName; // "Doe"
customer.groups; // ["admin", "user"]
customer.age; // 34

To combine it with knowledge from previous sections, we can write expressions such as:

customer.firstName + " " + customer.lastName // "John Doe"
customer.age in [30..40] // true
contains(customer.groups, "admin") // true
tip

$ is also considered to be a part of context, and it refers to the current column (within a cell).