Skip to content

Expressions: Variables

Expressions may refer to variables to obtain runtime values. The variables accessible to an expression depend on the evaluation context. For example, expressions appearing within a journey will be able to access all variables defined in the journey via the Set Temporary Variables step. Similarly, expressions appearing in a function definition such as a web request definition will be able to access parameters declared for the function as variables.

To reference a variable in an expression, its name is specified in the expression. For example, to refer to the variable named user, use the expression user.

Set temporary variables

You can use the Set Temporary Variables step to set new variables in the journey. These will be available for use in expressions for subsequent journey steps.

Invoke Custom HTTP

The Invoke Custom HTTP step is similar to the Set Temporary Variable step and provides a simplified UI-based view to invoking a Web Service Function and storing its result in a temporary variable.

The result will always be an object with status and body keys, and will also include headers and multiValueHeaders keys when the response contains headers. status is numeric HTTP status code of the response, body contains the response of the web service invocation, and headers/multiValueHeaders contain the response headers as single values and as arrays of values respectively. For example, successful invocation of web service configured with JSON response format may look as follows:

{
   "status" : 200, 
   "headers": { 
      "content-type": "application/json" 
   }, 
   "multiValueHeaders": { 
      "content-type": ["application/json"] 
   }, 
   "body": { 
      "result": "ok", 
      "count":1
   }
}