Variables

The most important and helpful function of EL is providing access to collection of variables available in the context generated by platform components.

For example, if a context has defined variable part, access to this variable can be encoded as ${part}.

Variables and Attributes

If a variable is an object and has attributes, the proper syntax is variable name-dot-attribute name.

For example, if variable parthas attribute serialNumber, access to this attribute must be encoded as ${part.serialNumber}.

The attribute can itself be an object with its own attributes. For example, variable part could have attribute location which contains two attributes latitude and longitude. In this case, the syntax to access latitude is ${part.location.latitude}.

Variables and Routines

Within the context of routines, variables take a number of forms, for example the routine origin will pass in variables, be it a ${message} variable with message values, the resource or group that the incoming message device is connected to ${source} which could also represent the object being passed into the routine by a form.

We can alternatively create a local variable by saving the results of a find or select action in the routine.

For example if we search for a customer meeting certain criteria, once found we can save this customer as a variable ${cust}, have access to its attributes and reference later in our routine.

![] (..\images\ELVariables1.png)

We can also set a variable in a routine using the "Set Variable" action which allows us to create a variable using EL functions, operators or simply set static values.