Skip to content

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.

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.
VariableTypeDescriptionExample
$Session.aniStringCaller’s number, taken from the ANI (Automatic Number Identification) signal."15812340987"
$Session.callidStringUnique identifier for the call."1751336277.2"
$Session.didStringThe DID (Direct Inward Dialing) number the caller dialed to reach this flow."5503301"
$Session.flowNumStringThe extension number of the call flow the caller reached."6900"
$Session.transferingNumStringThe number the call was forwarded from."1000"

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.
VariableTypeDescriptionExample value
$Prompt{index}.ttsResultStringText-to-speech result.PromptTTSResult.Success
VariableTypeDescriptionExample value
$Menu{index}.resultStringOutcome 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}.ttsResultStringText-to-speech result.MenuTTSResult.Success
$Menu{index}.userInputStringThe 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"
VariableTypeDescriptionExample value
$UserInput{index}.resultStringOutcome 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}.ttsResultStringText-to-speech result.UserInputTTSResult.Success
$UserInput{index}.userInputStringThe DTMF digit the caller pressed, excluding the end key (# or *)."2"
VariableTypeDescriptionExample value
$Record{index}.ttsResultStringText-to-speech result.RecordTTSResult.Timeout
VariableTypeDescriptionExample value
$DialByNumber{index}.ttsResultStringText-to-speech result.DialByNumberTTSResult.Success
VariableTypeDescriptionExample value
$Transfer{index}.ttsResultStringText-to-speech result.TransferTTSResult.Success
VariableTypeDescriptionExample value
$GetExtensionStatus{index}.currentProfileNameStringName of the extension’s current presence status."Available"
$GetExtensionStatus{index}.currentProfileStringName plus any extra detail of the extension’s current presence status."Available,work"
$GetExtensionStatus{index}.isUnavailableBooleanWhether the extension is unregistered.False
$GetExtensionStatus{index}.isInCallBooleanWhether 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}.isInRingBooleanWhether the extension is ringing.
True, at least one endpoint registered to the extension is ringing.
False, none of the registered endpoints are ringing.
False
VariableTypeDescriptionExample value
$GetQueueAgent{index}.agentListObjectAgents 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}.agentNumberListObjectAgents in a given queue that have a given status, returned as each agent’s extension number only."1001,1003,1004"
VariableTypeDescriptionExample value
$GetQueueInfo{index}.availableAgentsIntegerNumber of agents currently available to take calls.5
$GetQueueInfo{index}.unavailableAgentsIntegerNumber of agents currently unavailable to take calls.1
$GetQueueInfo{index}.callsActiveIntegerNumber of calls agents are currently handling.2
$GetQueueInfo{index}.callsWaitingIntegerNumber of calls currently waiting in the queue.10
VariableTypeDescriptionExample value
$GetAgentStatus{index}.currentProfileStringName plus any extra detail of the agent’s current status."Log Out"
$GetAgentStatus{index}.isInCallBooleanWhether the agent is on a call.
True, the agent is on a call.
False, the agent is not on a call.
True
$GetAgentStatus{index}.isInRingBooleanWhether the agent’s extension is ringing.
True, the extension is ringing.
False, the extension is not ringing.
True
VariableTypeDescriptionExample value
$GetSystemInfo{index}.deviceNameStringDevice name."PBX"
$GetSystemInfo{index}.modelNameStringProduct model."Cloud Voice"
$GetSystemInfo{index}.snStringSerial number."3631A2124123"
$GetSystemInfo{index}.firmwareVersionStringFirmware version."84.22.0.17-beta1"
$GetSystemInfo{index}.systemTimeStringCurrent system time."2026/01/30 09:46:44"
$GetSystemInfo{index}.systemUptimeIntegerSystem uptime, in seconds.88606
VariableTypeDescriptionExample value
$GetSystemCapacity{index}.extensionCapacityIntegerMaximum number of extensions supported.50
$GetSystemCapacity{index}.extensionUsedIntegerNumber of extensions in use.33
$GetSystemCapacity{index}.ccCapacityIntegerMaximum number of concurrent calls supported.25
$GetSystemCapacity{index}.ccUsedIntegerNumber of concurrent calls in use.1
VariableTypeDescriptionExample value
$GetExtensionInfo{index}.numberStringExtension number."1001"
$GetExtensionInfo{index}.nameStringExtension name."Phillip Huff"
$GetExtensionInfo{index}.emailStringExtension’s email address."phillip@sample.com"
$GetExtensionInfo{index}.mobileNumberStringExtension’s mobile number."15880123456"
VariableTypeDescriptionExample value
$GetCompanyContactInfo{index}.contactNameStringContact name."Leo Poll"
$GetCompanyContactInfo{index}.companyStringCompany name."Acme"
$GetCompanyContactInfo{index}.emailStringEmail address."leo@acme.com"
$GetCompanyContactInfo{index}.phonebookListStringPhonebook(s) the contact belongs to."All"
$GetCompanyContactInfo{index}.remarkStringNote about the contact."remark"
$GetCompanyContactInfo{index}.businessStringBusiness number."01082345678"
$GetCompanyContactInfo{index}.business2StringSecond business number."02160123456"
$GetCompanyContactInfo{index}.mobileStringMobile number."13800001234"
$GetCompanyContactInfo{index}.mobile2StringSecond mobile number."15900005678"
$GetCompanyContactInfo{index}.homeStringHome number."01087654321"
$GetCompanyContactInfo{index}.home2StringSecond home number."075523456789"
$GetCompanyContactInfo{index}.businessFaxStringBusiness fax number."01082345679"
$GetCompanyContactInfo{index}.homeFaxStringHome fax number."02160123457"
$GetCompanyContactInfo{index}.otherStringOther phone number."4008880000"
VariableTypeDescriptionExample value
$DatabaseAccess{index}.queryResultObjectThe table returned by a SELECT query."demo%40example.com"
$DatabaseAccess{index}.nonQueryResultIntegerNumber of rows affected by a non-query statement.99
$DatabaseAccess{index}.scalarResultStringThe single value returned by a scalar query."10"
VariableTypeDescriptionExample value
$HttpRequest{index}.responseContentStringBody of the HTTP response.{"authenticated": true, "user": "10000"}
$HttpRequest{index}.responseStatusCodeStringHTTP status code of the response."200"

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.

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")) returns True only 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)) returns True if 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) returns True when 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") returns True if 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) returns True if 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") returns True if the extension’s presence status contains Available.

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) returns True if 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) returns True if 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) returns True if 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) returns True if 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" returns True.

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 +86 country 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 the status key 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".

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".

FX_LEN: Returns the number of characters in the text.

  • Syntax: FX_LEN(text)
  • Input: String. Output: Integer.
  • Example: FX_LEN("13800138000") returns 11.

FX_SUM: Adds two or more 32-bit integers.

  • Syntax: FX_SUM(value1, value2, …)
  • Input: Integer. Output: Integer.
  • Example: FX_SUM(100, 200, 300) returns 600.

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) returns 3500000000.

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) returns 600.

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) returns 2000000000.

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) returns 5.

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) returns 5.

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) returns 100.

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) returns 10000000000.

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 the httpStatus key 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 integer 12345.

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 integer 1234567890123.

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 the phoneNumber value from the first object in the data array.

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 the data key in the JSON returned by the HTTP Request 1 component.