Scope Reference

There are a number of different scopes in the EL, some of which you can use to create your own variables. This page explains which scopes exist, whether you can use the scope for custom variables, and whether built-in variables exist that use the scope.

Service and system scopes

In the following table, the Custom and Built-in columns indicate if you can create your own (custom) variables using the scope and if there are built-in variables available.

Scope

Description

Custom

Built-in

system

 

The variable value is MEP system-wide. For example, the built-in variable system.time retrieves the current time and date for London, United Kingdom. Only one instance exists for these variables with the value updated by the MEP system.

You can use system variables in the Services, Broadcasts and Subscriptions tabs.

No

 

Yes

 

servicecoll

 

The variable value is shared by all services within the same service collection. This means that it is the same variable instance for all end users who access any service in the service collection.

Servicecoll variables support unicode values. The maximum length is 255 unicode characters.

Variables with this scope can only be used within the Services tab.

Yes

 

No

 

service

 

The variable value is unique for each service. This means that it is the same variable instance for all end users who access the service.

Service variables support unicode values. The maximum length is 255 unicode characters.

Variables with this scope can only be used within the Services tab.

Yes

 

Yes

 

session

 

The variable value exists for the duration of a session.

When a user accesses a service, a session is created for them. Once an end user has reached the end of a service, the session that the end user had is destroyed. If your service contains a "wait for message" handler, then the session is used to store the state until the service receives another message from the end user. A variable created on a session is available until the end user has reached the end of the service, even if this takes several messages.

Variables with this scope can only be used within the Services tab.

Yes

 

Yes

 

request

 

The variable value exists only for the duration of a request within a service.

Each time a service is triggered, a new request begins. A request ends when a new request is started. During a service, a new request begins when any of these actions occur:

  • The service receives a message (SMS, MMS, email).
  • The service pauses for any reason (such as a "wait for message" handler).
  • The service sends or fetches data (HTTP Poke and Get External Data handlers).

Each request variable is created for the specific request instance and is accessible for only that part of the service. For example, the next time that an end user sends an SMS message to a service, new instances of the request variables are created.

As values using this scope are generally short-lived, you may want to reference a built-in request variable using a custom variable. There are also parallel built-in session variables that you can use as an alternative in some instances.

Variables with this scope can only be used within the Services tab.

Yes

 

Yes

 

End user orientated scopes

These scopes are associated with an end user and their use of your services.

In the table, the Custom and Built-in columns indicate if you can create your own (custom) variables using the scope and if there are built-in variables available.

Scope

Description

Custom

Built-in

user

 

The variable value is associated with a specific end user across all of your services and collections. This means that each user has their own unique instance of the variable, shared across all your services.

User variables support unicode values. The maximum length is 4096 unicode characters.

Note that you cannot create a custom user.identifiers variable (e.g. user.identifiers.xxx). This range of variables is restricted to existing and future built-in variables.

You can use variables with this scope in the Services, Subscriptions and Broadcasts tabs..

Yes

 

Yes

userservice

 

The variable value is associated with a particular end user for a particular service. The same variable value is used whenever that end user accesses the service, but not if the user accesses a different service.

Userservice variables support unicode values. The maximum length is 4096 unicode characters.

You can use variables with this scope in the Services tab only.

Yes

 

No

 

userservicecoll

 

The variable value is associated with a specific end user for all services within the same collection.

Userservicecoll variables support unicode values. The maximum length is 4096 unicode characters.

You can use variables with this scope in the Services tab only.

Yes

No

Upload scope (broadcasting only)

The upload scope is available in the Broadcasts tab only. Upload variables reference customer-linked data uploaded via a CSV file. Once the data is uploaded, you can reference the upload variables in the broadcast message.

Upload variables are created from the columns in a CSV file. The first column in the CSV must contain the mobile numbers of your customers. Each column after the first column becomes accessible via upload variables.

For example, in the following table, the column headings become the variable key and each cell becomes the value of the variable for that customer.

MSISDN

firstname

offer

PIN

447700900750

Beth

cappuccino

54321

447700900765

John

mug

43215

447700900912

Samuel

t-shirt

32154

In this example, the variables are: upload.firstname, upload.offer, and upload.PIN.

If your CSV file does not have headings, then MEP will automatically create a variable, which you can rename when using the upload interface.

You can only use upload variables when you upload a CSV file. The variables only exist for the specific broadcast; you cannot reference them in a different broadcast or in other areas of MEP. If you reuse a broadcast, then you will need to upload the same CSV file to add the mobile number and variable information again.