Variables and Functions in Expressions
Expressions let a call flow react to live data as a call moves through it. You build them from two kinds of pieces: variables, which carry data about the current call, the components already in the flow, and the system; and functions, which test or transform that data. This page lists every variable and function available in Call Flow Designer.
Variables
Section titled “Variables”A variable pulls in a value at run time and passes it along the flow. There are two kinds:
- Session variables hold information about the current call. They are available anywhere in the flow and do not depend on any component being present.
- Component variables hold values produced by a specific component, and only become available once that component has been added to the flow.
Session variables
Section titled “Session variables”| Variable | Type | Description | Example |
|---|---|---|---|
$Session.ani | String | Caller’s number, taken from the ANI (Automatic Number Identification) signal. | "15812340987" |
$Session.callid | String | Unique identifier for the call. | "1751336277.2" |
$Session.did | String | The DID (Direct Inward Dialing) number the caller dialed to reach this flow. | "5503301" |
$Session.flowNum | String | The extension number of the call flow the caller reached. | "6900" |
$Session.transferingNum | String | The number the call was forwarded from. | "1000" |
Component variables
Section titled “Component variables”Several playback components expose a ttsResult variable that reports how text-to-speech conversion went. In every case the value is one of two constants:
<Component>TTSResult.Success, the text was converted to speech and played to the caller.<Component>TTSResult.Timeout, the text was not converted within the timeout window, so Cloud Voice skipped the prompt and sent the caller straight to the next component.
Prompt
Section titled “Prompt”| Variable | Type | Description | Example value |
|---|---|---|---|
$Prompt{index}.ttsResult | String | Text-to-speech result. | PromptTTSResult.Success |
| Variable | Type | Description | Example value |
|---|---|---|---|
$Menu{index}.result | String | Outcome of the Menu component.MenuResult.Timeout, no digit before the timeout; routed to the timeout destination.MenuResult.ValidOption, valid key; routed to the matching destination.MenuResult.InvalidOption, invalid key; routed to the no-match destination. | MenuResult.InvalidOption |
$Menu{index}.ttsResult | String | Text-to-speech result. | MenuTTSResult.Success |
$Menu{index}.userInput | String | The DTMF (Dual-Tone Multi-Frequency, the touch-tone a keypad sends) digit the caller pressed, excluding the end key set under Call Flow Designer > Options > End Key. | "2" |
User Input
Section titled “User Input”| Variable | Type | Description | Example value |
|---|---|---|---|
$UserInput{index}.result | String | Outcome of the User Input component.UserInputResult.Timeout, no digit before the timeout; routed to the timeout destination.UserInputResult.ValidOption, valid key; routed to the matching destination. | UserInputResult.Timeout |
$UserInput{index}.ttsResult | String | Text-to-speech result. | UserInputTTSResult.Success |
$UserInput{index}.userInput | String | The DTMF digit the caller pressed, excluding the end key (# or *). | "2" |
Record
Section titled “Record”| Variable | Type | Description | Example value |
|---|---|---|---|
$Record{index}.ttsResult | String | Text-to-speech result. | RecordTTSResult.Timeout |
Dial by Number
Section titled “Dial by Number”| Variable | Type | Description | Example value |
|---|---|---|---|
$DialByNumber{index}.ttsResult | String | Text-to-speech result. | DialByNumberTTSResult.Success |
Transfer
Section titled “Transfer”| Variable | Type | Description | Example value |
|---|---|---|---|
$Transfer{index}.ttsResult | String | Text-to-speech result. | TransferTTSResult.Success |
Get Extension Presence Status
Section titled “Get Extension Presence Status”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetExtensionStatus{index}.currentProfileName | String | Name of the extension’s current presence status. | "Available" |
$GetExtensionStatus{index}.currentProfile | String | Name plus any extra detail of the extension’s current presence status. | "Available,work" |
$GetExtensionStatus{index}.isUnavailable | Boolean | Whether the extension is unregistered. | False |
$GetExtensionStatus{index}.isInCall | Boolean | Whether the extension is on a call.True, at least one endpoint registered to the extension is on a call.False, none of the registered endpoints are on a call. | True |
$GetExtensionStatus{index}.isInRing | Boolean | Whether the extension is ringing.True, at least one endpoint registered to the extension is ringing.False, none of the registered endpoints are ringing. | False |
Get Queue Agent
Section titled “Get Queue Agent”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetQueueAgent{index}.agentList | Object | Agents in a given queue that have a given status, returned as each agent’s extension number and current status. | "1001,Log Out;1003,Log Out;1004,Log Out" |
$GetQueueAgent{index}.agentNumberList | Object | Agents in a given queue that have a given status, returned as each agent’s extension number only. | "1001,1003,1004" |
Get Queue Info
Section titled “Get Queue Info”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetQueueInfo{index}.availableAgents | Integer | Number of agents currently available to take calls. | 5 |
$GetQueueInfo{index}.unavailableAgents | Integer | Number of agents currently unavailable to take calls. | 1 |
$GetQueueInfo{index}.callsActive | Integer | Number of calls agents are currently handling. | 2 |
$GetQueueInfo{index}.callsWaiting | Integer | Number of calls currently waiting in the queue. | 10 |
Get Agent Status
Section titled “Get Agent Status”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetAgentStatus{index}.currentProfile | String | Name plus any extra detail of the agent’s current status. | "Log Out" |
$GetAgentStatus{index}.isInCall | Boolean | Whether the agent is on a call.True, the agent is on a call.False, the agent is not on a call. | True |
$GetAgentStatus{index}.isInRing | Boolean | Whether the agent’s extension is ringing.True, the extension is ringing.False, the extension is not ringing. | True |
Get System Info
Section titled “Get System Info”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetSystemInfo{index}.deviceName | String | Device name. | "PBX" |
$GetSystemInfo{index}.modelName | String | Product model. | "Cloud Voice" |
$GetSystemInfo{index}.sn | String | Serial number. | "3631A2124123" |
$GetSystemInfo{index}.firmwareVersion | String | Firmware version. | "84.22.0.17-beta1" |
$GetSystemInfo{index}.systemTime | String | Current system time. | "2026/01/30 09:46:44" |
$GetSystemInfo{index}.systemUptime | Integer | System uptime, in seconds. | 88606 |
Get System Capacity
Section titled “Get System Capacity”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetSystemCapacity{index}.extensionCapacity | Integer | Maximum number of extensions supported. | 50 |
$GetSystemCapacity{index}.extensionUsed | Integer | Number of extensions in use. | 33 |
$GetSystemCapacity{index}.ccCapacity | Integer | Maximum number of concurrent calls supported. | 25 |
$GetSystemCapacity{index}.ccUsed | Integer | Number of concurrent calls in use. | 1 |
Get Extension Info
Section titled “Get Extension Info”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetExtensionInfo{index}.number | String | Extension number. | "1001" |
$GetExtensionInfo{index}.name | String | Extension name. | "Phillip Huff" |
$GetExtensionInfo{index}.email | String | Extension’s email address. | "phillip@sample.com" |
$GetExtensionInfo{index}.mobileNumber | String | Extension’s mobile number. | "15880123456" |
Get Company Contact Info
Section titled “Get Company Contact Info”| Variable | Type | Description | Example value |
|---|---|---|---|
$GetCompanyContactInfo{index}.contactName | String | Contact name. | "Leo Poll" |
$GetCompanyContactInfo{index}.company | String | Company name. | "Acme" |
$GetCompanyContactInfo{index}.email | String | Email address. | "leo@acme.com" |
$GetCompanyContactInfo{index}.phonebookList | String | Phonebook(s) the contact belongs to. | "All" |
$GetCompanyContactInfo{index}.remark | String | Note about the contact. | "remark" |
$GetCompanyContactInfo{index}.business | String | Business number. | "01082345678" |
$GetCompanyContactInfo{index}.business2 | String | Second business number. | "02160123456" |
$GetCompanyContactInfo{index}.mobile | String | Mobile number. | "13800001234" |
$GetCompanyContactInfo{index}.mobile2 | String | Second mobile number. | "15900005678" |
$GetCompanyContactInfo{index}.home | String | Home number. | "01087654321" |
$GetCompanyContactInfo{index}.home2 | String | Second home number. | "075523456789" |
$GetCompanyContactInfo{index}.businessFax | String | Business fax number. | "01082345679" |
$GetCompanyContactInfo{index}.homeFax | String | Home fax number. | "02160123457" |
$GetCompanyContactInfo{index}.other | String | Other phone number. | "4008880000" |
Database Access
Section titled “Database Access”| Variable | Type | Description | Example value |
|---|---|---|---|
$DatabaseAccess{index}.queryResult | Object | The table returned by a SELECT query. | "demo%40example.com" |
$DatabaseAccess{index}.nonQueryResult | Integer | Number of rows affected by a non-query statement. | 99 |
$DatabaseAccess{index}.scalarResult | String | The single value returned by a scalar query. | "10" |
HTTP Request
Section titled “HTTP Request”| Variable | Type | Description | Example value |
|---|---|---|---|
$HttpRequest{index}.responseContent | String | Body of the HTTP response. | {"authenticated": true, "user": "10000"} |
$HttpRequest{index}.responseStatusCode | String | HTTP status code of the response. | "200" |
Functions
Section titled “Functions”Functions evaluate conditions and process data so you can steer a call flow dynamically. Each entry below lists its syntax, the input and output types, and an example. They are grouped by the type of value they return.
Boolean functions
Section titled “Boolean functions”FX_AND: Logical AND across two or more conditions; returns True only when all of them are met at once.
- Syntax:
FX_AND(condition1, condition2, …) - Input: Boolean. Output: Boolean.
- Example:
FX_AND(FX_EQUAL($UserInput1.userInput, "1"), FX_EQUAL($Session.ani, "1001"))returnsTrueonly when the caller pressed 1 and is calling from 1001.
FX_OR: Logical OR across two or more conditions; returns True when any of them is met.
- Syntax:
FX_OR(condition1, condition2, …) - Input: Boolean. Output: Boolean.
- Example:
FX_OR(FX_EQUAL($Session.ani, "1001"), FX_EQUAL($GetAgentStatus1.isInCall, False))returnsTrueif the caller’s number is 1001 or the agent is not on a call.
FX_NOT: Inverts the Boolean result of a single condition.
- Syntax:
FX_NOT(condition) - Input: Boolean. Output: Boolean.
- Example:
FX_NOT($GetExtensionStatus1.isInCall)returnsTruewhen the extension is not on a call.
FX_EQUAL: Tests whether two values are equal in both value and data type.
- Syntax:
FX_EQUAL(value1, value2) - Input: any. Output: Boolean.
- Example:
FX_EQUAL($Session.ani, "1001")returnsTrueif the caller’s number is a string with the exact value"1001".
FX_NOT_EQUAL: Tests whether two values are not equal.
- Syntax:
FX_NOT_EQUAL(value1, value2) - Input: any. Output: Boolean.
- Example:
FX_NOT_EQUAL($GetAgentStatus1.isInRing, True)returnsTrueif the agent is not ringing.
FX_CONTAINS: Tests whether the first string contains the second.
- Syntax:
FX_CONTAINS(value1, value2) - Input: String. Output: Boolean.
- Example:
FX_CONTAINS($GetExtensionStatus1.currentProfile, "Available")returnsTrueif the extension’s presence status containsAvailable.
FX_GREATER_THAN: Tests whether the first value is greater than the second.
- Syntax:
FX_GREATER_THAN(value1, value2) - Input: Integer. Output: Boolean.
- Example:
FX_GREATER_THAN($GetQueueInfo1.callsWaiting, 5)returnsTrueif more than 5 calls are waiting in the queue.
FX_GREATER_THAN_OR_EQUAL: Tests whether the first value is greater than or equal to the second.
- Syntax:
FX_GREATER_THAN_OR_EQUAL(value1, value2) - Input: Integer. Output: Boolean.
- Example:
FX_GREATER_THAN_OR_EQUAL($GetQueueInfo1.callsWaiting, 5)returnsTrueif 5 or more calls are waiting.
FX_LESS_THAN: Tests whether the first value is less than the second.
- Syntax:
FX_LESS_THAN(value1, value2) - Input: Integer. Output: Boolean.
- Example:
FX_LESS_THAN($GetQueueInfo1.callsWaiting, 5)returnsTrueif fewer than 5 calls are waiting.
FX_LESS_THAN_OR_EQUAL: Tests whether the first value is less than or equal to the second.
- Syntax:
FX_LESS_THAN_OR_EQUAL(value1, value2) - Input: Integer. Output: Boolean.
- Example:
FX_LESS_THAN_OR_EQUAL($GetQueueInfo1.callsWaiting, 5)returnsTrueif 5 or fewer calls are waiting.
FX_TO_BOOLEAN: Converts a value to a Boolean.
- Syntax:
FX_TO_BOOLEAN(value) - Input: any. Output: Boolean.
- Example:
FX_TO_BOOLEAN($GetExtensionStatus1.currentProfile)converts the value from a Get Extension Presence Status component to a Boolean, for instance,"Available"returnsTrue.
String functions
Section titled “String functions”FX_CONCATENATE: Joins every string argument into one string.
- Syntax:
FX_CONCATENATE(string1, string2, …) - Input: String. Output: String.
- Example:
FX_CONCATENATE("Caller", $Session.ani, "called", $Session.flowNum)combines the caller’s number and flow number into one string, such as"Caller1001called6900".
FX_TRIM: Removes leading and trailing whitespace (spaces, newlines, and so on) from a value.
- Syntax:
FX_TRIM(value) - Input: String. Output: String.
- Example:
FX_TRIM(" Hello ")returns"Hello".
FX_LEFT: Returns a set number of characters from the start of the text.
- Syntax:
FX_LEFT(text, count) - Input:
text(String),count(Integer). Output: String. - Example:
FX_LEFT("13800138000", 3)returns"138".
FX_MID: Returns a substring beginning at a given position for a given length.
- Syntax:
FX_MID(text, start_position, length) - Input:
text(String),start_position(Integer),length(Integer). Output: String. - Example:
FX_MID("13800138000", 4, 4)returns"0013", four characters starting at the fourth character.
FX_RIGHT: Returns a set number of characters from the end of the text.
- Syntax:
FX_RIGHT(text, count) - Input:
text(String),count(Integer). Output: String. - Example:
FX_RIGHT("13800138000", 4)returns"8000".
FX_UPPER: Converts all characters in the text to uppercase.
- Syntax:
FX_UPPER(text) - Input: String. Output: String.
- Example:
FX_UPPER("Cloud Voice")returns"CLOUD VOICE".
FX_LOWER: Converts all characters in the text to lowercase.
- Syntax:
FX_LOWER(text) - Input: String. Output: String.
- Example:
FX_LOWER("Cloud Voice")returns"cloud voice".
FX_REPLACE: Replaces every occurrence of a substring with another substring.
- Syntax:
FX_REPLACE(text, target, replacement) - Input:
text(String),target(String),replacement(String). Output: String. - Example:
FX_REPLACE("+8613800138000", "+86", "")strips the+86country code and returns"13800138000".
FX_REPLACE_REG_EXP: Replaces substrings matching a regular expression with a replacement string.
- Syntax:
FX_REPLACE_REG_EXP(text, expression, replacement) - Input:
text(String),expression(String),replacement(String). Output: String. - Example:
FX_REPLACE_REG_EXP("Call123", "[0-9]", "X")matches every digit and returns"CallXXX".
FX_JSON_GET_STRING: Reads a string value from a JSON object by key.
- Syntax:
FX_JSON_GET_STRING(JSONObject, key) - Input:
JSONObject(String),key(String). Output: String. - Example:
FX_JSON_GET_STRING($HttpRequest1.responseContent, "status")returns the value of thestatuskey in the JSON returned by the HTTP Request 1 component.
FX_TO_STRING: Converts a value to a string.
- Syntax:
FX_TO_STRING(value) - Input: any. Output: String.
- Example:
FX_TO_STRING(10086)returns"10086".
Date and time functions
Section titled “Date and time functions”FX_NOW: Returns the current date and time as a DateTime value.
- Syntax:
FX_NOW() - Input: none. Output: DateTime.
- Example:
FX_NOW()returns the current system date and time, such as"2025-07-01 17:29:08".
Number functions
Section titled “Number functions”FX_LEN: Returns the number of characters in the text.
- Syntax:
FX_LEN(text) - Input: String. Output: Integer.
- Example:
FX_LEN("13800138000")returns11.
FX_SUM: Adds two or more 32-bit integers.
- Syntax:
FX_SUM(value1, value2, …) - Input: Integer. Output: Integer.
- Example:
FX_SUM(100, 200, 300)returns600.
FX_SUM_LONG: Adds two or more 64-bit integers.
- Syntax:
FX_SUM_LONG(value1, value2, …) - Input: Integer. Output: Integer.
- Example:
FX_SUM_LONG(1000000000, 2500000000)returns3500000000.
FX_NEGATIVE: Returns the negative of a 32-bit integer.
- Syntax:
FX_NEGATIVE(value) - Input: Integer. Output: Integer.
- Example:
FX_NEGATIVE(100)returns-100.
FX_NEGATIVE_LONG: Returns the negative of a 64-bit integer.
- Syntax:
FX_NEGATIVE_LONG(value) - Input: Integer. Output: Integer.
- Example:
FX_NEGATIVE_LONG(1000000000)returns-1000000000.
FX_MULTIPLY: Multiplies two or more 32-bit integers.
- Syntax:
FX_MULTIPLY(value1, value2, …) - Input: Integer. Output: Integer.
- Example:
FX_MULTIPLY(10, 20, 3)returns600.
FX_MULTIPLY_LONG: Multiplies two or more 64-bit integers.
- Syntax:
FX_MULTIPLY_LONG(value1, value2, …) - Input: Integer. Output: Integer.
- Example:
FX_MULTIPLY_LONG(100000, 20000)returns2000000000.
FX_DIVIDE: Divides the first 32-bit integer by the second.
- Syntax:
FX_DIVIDE(value1, value2) - Input: Integer. Output: Integer.
- Example:
FX_DIVIDE(100, 20)returns5.
FX_DIVIDE_LONG: Divides the first 64-bit integer by the second.
- Syntax:
FX_DIVIDE_LONG(value1, value2) - Input: Integer. Output: Integer.
- Example:
FX_DIVIDE_LONG(10000000000, 2000000000)returns5.
FX_ABS: Returns the absolute (non-negative) value of a 32-bit integer.
- Syntax:
FX_ABS(value) - Input: Integer. Output: Integer.
- Example:
FX_ABS(-100)returns100.
FX_ABS_LONG: Returns the absolute (non-negative) value of a 64-bit integer.
- Syntax:
FX_ABS_LONG(value) - Input: Integer. Output: Integer.
- Example:
FX_ABS_LONG(-10000000000)returns10000000000.
FX_GET_TABLE_ROW_COUNT: Returns the number of rows in a table.
- Syntax:
FX_GET_TABLE_ROW_COUNT(table) - Input: any. Output: Integer.
- Example:
FX_GET_TABLE_ROW_COUNT($DatabaseAccess1.queryResult)returns the row count of the result from the Database Access 1 component.
FX_GET_LIST_ITEM_COUNT: Returns the number of items in a list.
- Syntax:
FX_GET_LIST_ITEM_COUNT(list) - Input: any. Output: Integer.
- Example:
FX_GET_LIST_ITEM_COUNT($DatabaseAccess1.queryResult)returns the item count of the result from the Database Access 1 component.
FX_JSON_GET_INTEGER: Reads an integer value from a JSON object by key.
- Syntax:
FX_JSON_GET_INTEGER(JSONObject, key) - Input:
JSONObject(String),key(String). Output: Integer. - Example:
FX_JSON_GET_INTEGER($HttpRequest1.responseContent, "httpStatus")returns the value of thehttpStatuskey in the JSON returned by the HTTP Request 1 component.
FX_TO_INTEGER: Converts a value to a 32-bit integer.
- Syntax:
FX_TO_INTEGER(value) - Input: String. Output: Integer.
- Example:
FX_TO_INTEGER("12345")returns the integer12345.
FX_TO_LONG: Converts a value to a 64-bit integer.
- Syntax:
FX_TO_LONG(value) - Input: String. Output: Integer.
- Example:
FX_TO_LONG("1234567890123")returns the integer1234567890123.
Object functions
Section titled “Object functions”FX_GET_TABLE_CELL_VALUE: Returns the value in a table cell at a given row and column.
- Syntax:
FX_GET_TABLE_CELL_VALUE(table, row, column) - Input:
table(any),row(Integer),column(Integer). Output: Object. - Example:
FX_GET_TABLE_CELL_VALUE($DatabaseAccess1.queryResult, 0, 1)returns the value in the first row and second column of the result from the Database Access 1 component.
FX_GET_LIST_ITEM: Returns the item at a given index in a list.
- Syntax:
FX_GET_LIST_ITEM(list, index) - Input:
list(any),index(Integer). Output: Object. - Example:
FX_GET_LIST_ITEM($DatabaseAccess1.queryResult, 2)returns the third item in the result from the Database Access 1 component.
FX_GET_JSON_ARRAY_ITEM: Returns a field from the object at a given index within a JSON array.
- Syntax:
FX_GET_JSON_ARRAY_ITEM(jsonData, arrayKey, index, fieldName) - Input:
jsonData(String),arrayKey(String),index(Integer),fieldName(String). Output: Object. - Example:
FX_GET_JSON_ARRAY_ITEM($HttpRequest1.responseContent, "data", 0, "phoneNumber")returns thephoneNumbervalue from the first object in thedataarray.
FX_JSON_GET_OBJECT: Returns a nested JSON object from a parent object by key.
- Syntax:
FX_JSON_GET_OBJECT(JSONObject, key) - Input:
JSONObject(String),key(String). Output: Object. - Example:
FX_JSON_GET_OBJECT($HttpRequest1.responseContent, "data")returns the JSON object under thedatakey in the JSON returned by the HTTP Request 1 component.