Skip to main content

Uniphore Customer Portal

Adding Session Variables

Using the X-Console, you can create new Session Variables that store values for global use in Interact.

When you create a Session Variable, it is immediately available for use in any Flow. In addition, any default value set for it will automatically be assigned to it in the Designer and during runtime.

The following rules apply when creating Session Variables:

  • The variable name cannot be identical to that of an existing Session Variable.

  • The variable name cannot be identical to that of a User variable being used in the latest version of an existing Flow.

Creating a New Session Variable
  1. From the Resources section of the X-Console, click Session Variables. The Session Variables page is displayed.

  2. At the top left of the page, click Add New:

    SessionVarEditor-AddNewClick_051021.png

    A new Session Variables definition page is displayed:

    SessionVarEditor-AddVariableDefinition_051021.png
  3. In the Variable Name field, enter a unique name for the variable.

  4. From the Variable Type dropdown list, select its data type. Along with primitive types, you can also select a Dynamic Variable, a Collection or (at the bottom of the dropdown list) choose a Custom Type.

  5. From the Variable Scope dropdown list, select its Session type:

    • Customer Session - This type of Session Variable will be available in all Flows (including self-service Flows and agent-assisted Flows). The value of this variable is reset with each new Customer Session.

    • Agent Session - This type of Session Variable will only be available to Agent sessions (i.e., while an Agent is running the Agent application). The value of this variable is reset only after the Agent logs out of the session.

      Note

      Using an Agent variable in a Flow that runs a self-service application like Mobile Web, Web Self-Service or Customer Assistant will result in a runtime error.

  6. In the Description field, optionally enter notes or comments related to the Session Variable.

  7. When required, switch the Environment Variable toggle to indicate whether the new variable is an Environment-level variable (for use in Multi-Environment activities). For more information see Using Environment Variables.

    Note

    When Environment Variable is selected, the variable cannot be set to Read Only.

  8. Use the Read Only toggle to assign the status for the new variable:

    • On (Green Checkmark): The default value for the variable cannot be updated from the Designer.

    • Off (Red X): The default value for the variable can be allocated and updated from the Designer.

  9. When the variable is set to Read Only, enter a name in the Client Header field that will be used to populate the variable before the Flow is run.

  10. If desired, enter a Default Value for the new variable. The default input field contents will vary, depending on the variable type chosen:

    • Text: A textbox is provided.

    • Number: A numeric counter is provided.

    • Boolean: A dropdown menu is provided.

    • Date: A date picker is provided.

    • Dynamic: A JSON editor is provided, as detailed here. (You can paste default JSON code here as well.)

    • Custom Type: Fields are provided for each selected variable type, as described here.

    • Enum Type: A Default selection dropdown menu is provided, as described here.

    • Collection: Fields are provided for the selected Collection type, as described here.

  11. Use the Format field to set a preferred format for the new variable. Formats will vary, depending on the variable type chosen.

    To format a date variable, select the required date format from the dropdown menu that appears at the right. You can also use the Custom option to define a customized date format:

    SysVarEditor-CustomDate_200318.png

    For more information on formatting variables, click here.

  12. If it appears as an option, you can activate the Do not audit the variable’s value checkbox to prevent this variable from being saved in the X‑Platform database. This field helps to ensure the privacy of the variable's data.

  13. Optionally activate the Secure checkbox to securely mask the variable's value when it is displayed to the user, according to the character pattern you define:

    SecureVariableUIMasking_031019.png

    Note that the value will not be encrypted. This option is only available for Text type variables.

  14. Click Save. A confirmation message is displayed.

    You can exit the operation at anytime without saving changes by clicking Cancel.

Tip

When you add or make changes to a Session Variable, we recommend that you Refresh currently active Flows to update them with the new information and redraw them in the Designer. Use the Refresh button in the main toolbar of the Designer. For more information, click here.

Adding a Dynamic Variable Type as a Session Variable

You can create a Dynamic Variable that will be available globally to all Flows as a Session Variable.

  1. From the Variable Type dropdown list, select Dynamic:

    SysVarEditor-SelectDynamicVar_260218.png
  2. In the Default Value field, enter or paste the JSON code directly into the built-in JSON editor, as shown below:

    SysVarEditor-DynamicVarDefaultExample_260218.png

    For more information on using the editor, click here.

Adding a Custom Type as a Session Variable

When choosing the Variable Type for a new Session Variable, you can assign a Custom Type that already has been defined in the X-Console for use as a Session Variable:

SysVarEditor-SelectCustomTypeVar_260218.png

Find and select the name of the desired Custom Type at the bottom of the dropdown menu. For detailed information, refer to Working with Custom Types.

The Default Value field will provide a separate entry for each variable type of a regular Custom Type:

SysVarEditor-SelectCustomTypeVarRegExample_260218.png

If the Custom Type is an Enum, you can select the Default Value field from a dropdown menu:

SysVarEditor-SelectCustomTypeVarEnumExample_260218.png
Adding a Collection as a Session Variable

You can create a Collection of values that will be available globally to all Flows as a Session Variable.

Remember that all Collection values must be of the same type.

  1. From the Variable Type dropdown list, select Collection:

    SessionVarEditor-SelectCollectionVarType_051021.png
  2. From the Of dropdown list, select the variable type that will be used for the Collection, as shown in the example above.

    For more details on creating Collections, click here.

  3. In the Default Value field, enter a value for each member of the new Collection. The new Collection size will be set according to the number of Default Values that you provide.

    The following example adds default Date values:

    SysVarEditor-CollectionAddDefaultValues_120318.png
Handling Conflicts Caused by Duplicate Variable Names

Duplicating the names of Session and User variables is not allowed.

Should a Session Variable be created in the X-Console that has the same name as an existing User Variable in a Flow, the Conflicts Center panel will be displayed when the Flow with is opened in the Designer.

The Conflicts Center will assist you in locating the conflicting User Variable and prompt you to assign it a unique new name. Conflicting instances of the User Variable in the Flow will then be renamed with the new name.