Assigning Values to Variables in a Flow
Use the Assign object to define an attribute's name and value in your flow. For example, you can name and provide a value to a caller based on the digits that they pressed in a Collect Digits object. By using Assign, you can set a value that is meaningful for your flow so you can refer to it in conditions later in the same flow. The Assign Global object has the same function, but also applies to variables within sub flows.
- Name: This is the label or name for your variable. You can name your variable what you want, but you must enter it the exact same way anytime you use it in a condition later in your flow.
- Value: This is the value you are assigning to the corresponding name. For example, you might enter values such as:
- True
- False
- A number
- A string, such as digits pressed
If the value is a string such as true, false, or a digit pressed, surround the value in quotation marks. If it is not a string, such as another variable or a number, don't enter the value with quotation marks. |
Referencing Assigned Values in a Flow
With the Assign object, attributes can be referred to in the same portion of the flow as they were defined in. For example, if an attribute is defined with the Assign object in the caller's portion of a flow, it cannot be referenced in a separate sub-flow for the agent's portion unless you define it again.
With the Assign Global object, defined attributes can be referred to anywhere within the main flow and sub-flows.
Example #1
- The caller enters their account ID that indicates that they are entitled to a premium level of support.
-
An Assign object is placed after the decision branch to identify the customer based on the digits they placed.
- Name: Premium
- Value: "true"
-
Sample condition later in the flow:
-
A Play Media object stems off of a decision branch with a customized thank you message for premium customers. The condition in the exclusive gateway is (= "true" Premium).
-
Example #2
- A Collect Digits object gives the caller the option to press "1" for English or "2" for French. You want to set the attribute to easily refer to the caller's preferred language. In this example, it is English.
-
An Assign object is placed after the decision branch to identify the customer based on the digits they placed.
-
Name: language
-
Value: "English"
-
- Sample condition later in the flow:
Later in the flow you want to play a thank you message in English for any callers that selected English earlier in the flow. Set (= "English" language) as the condition.