Assign Variables Block
Use the Assign Variables block to assign a new value or expression to user variables.
You can use the Assign Variables block in any phase of the application to assign a new value or expression to any of the user variables. Those variables can be used in other blocks whose properties support variables (for example, TTS prompts). The last-known state of variables is captured in metrics just before the SCXML session ends.
User variables are specified in the User Variables tab of the Initialize phase. When the application starts, those user variables are declared and assigned the user-specified default value.
You can use the Sort Function tab to sort the elements of a JSON array in a specified order. A maximum of three keys can be specified with each array. The same array can be sorted multiple times; therefore, the number of sort keys is unlimited.
Click Add Assignment to assign a value or expression to a variable.
- Select a variable from the Variable drop-down menu.
- If you are using a function in an Expression and are on Designer Private Edition or Multicloud CX hosted on Azure, you must include a directive. See Using functions in expressions for more information.
Using functions in expressions
For Designer deployments on Private Edition or Genesys Multicloud CX hosted on Azure, the following directive must be added when using a function in expressions:
/*pragma:ors_await*/ _genesys.queue.priorityTuning(InteractionID, true, false, false);
/*pragma:ors_await*/ _genesys.queue.setInteractionAge(InteractionID, true);
Sort Function tab
Click Add Sort Function and select an Input Array that contains a valid JSON array with values that you want to sort.
Enter up to three values in the Key to Sort By fields. These values must exist in the array. If an element does not have the specified value, it is skipped by the sort function and the value appears towards the end of the list.
Optionally, specify a Sort Order and Key Data Type. For the date type, you can use the following formats:
- Example in Greenwich Mean Time (Zulu): 2015-06-01T12:13:14Z
- Example in Pacific Time: 2015-06-01T12:13:14-0800
Advanced Scripting tab
Click Advanced Scripting to enter your own ECMAScript expression. For more information, see ECMAScript Expressions.