Genpact Cora Knowledge Center

Support

Manage Application Variables

Overview

Application variables are dynamic variables that enable you to reuse values that you commonly use in Cora SeQuence. You define a key and its value in the Application Variables table, and then use the key in any Cora SeQuence expression.

Use Cases

  • A central location to manage values that are different between environments.
  • You want the SLA to remain constant across all workflows in the workflow space. You can define the SLA as an application variable with a value, and use the variable in expressions. In the future, if the SLA changes, instead of having to update the SLA value everywhere the key is used, you just update the value in the Application Variables table. In this example, we'll set the SLA to 3 days.

Create an Application Variable

In the Administration site navigate to Administration > Global Settings > Application Variables > Add New Record.

Define the Key and the Value. In this example, we define the SLA as three hours.

Use the Key in an Expression

When you define the key and value in the Administration site, you can use the key in an expression using these formats. The key and value must be in quotation marks.

rt.GetAppVariable("Key")

rt.GetAppVariable("Key", "DefaultValue")

Important Notes

  • In an expression, when you try to use a key that does not exist in the Application Variables table and there is no default value set for it, the result will be Null.
  • When you use a key that does not exist in the Application Variables table, and do not specify a default value, the result will be Null. For example, if you use the key Cost, rt.GetAppVariable("Cost"), and it is not defined, the result will be null. When you want to use the key, you should define a default value for the key, rt.GetAppVariable("Key", "defaultValue"). This is especially helpful in cases where you don't know if the key exists in the table. For our example, the expression would be rt.GetAppVariable("Cost", "37").