ToBoolean Function
Use ToBoolean to convert values from a different data type to a boolean.
ToBoolean supports the following data types:
- text
- number
- yes/no(boolean)
Description 1 of 4 (convert a text value):
Convert a text value to a boolean value.
The text value
"true"
(not case sensitive) is converted to the boolean value true
, and all other text values are converted to the boolean value false
. Returns:
Boolean
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Text | The text to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToBoolean(VariableName)}
Expression | Result |
|---|---|
ToBoolean( "TruE" ) | true |
ToBoolean( "FaLsE" ) | false |
ToBoolean( "" ) | false |
Description 2 of 4 (convert a number value):
Convert a number value to a boolean value.
The number
0
is converted to the boolean value false
, and all other numbers are converted to the boolean value true
. Returns:
Boolean
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Number | The number to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToBoolean(VariableName)}
Expression | Result |
|---|---|
ToBoolean( 0 ) | false |
ToBoolean( 0.000001 ) | true |
ToBoolean( -123 ) | true |
Description 3 of 4 (convert a list of text values):
Convert a list of text values to a list of boolean values.
The text value
"true"
(not case sensitive) is converted to the boolean value true
, and all other text values are converted to the boolean value false
. Returns:
A List of Boolean values
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Text* | The list of text values to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToBoolean(VariableName)}
Expression | Result |
|---|---|
ToBoolean( List("TruE", "false", "blue") ) | List(true, false, false) |
ToBoolean( List("FaLsE", "green", "ratchet") ) | List(false, false, false) |
Description 4 of 4 (convert a list of number values):
Convert a list of number values to a list of boolean values.
The number
0
is converted to the boolean value false
, and all other numbers are converted to the boolean value true
. Returns:
A List of Boolean values
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Number* | The list of numbers to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToBoolean(VariableName)}
Expression | Result |
|---|---|
ToBoolean( List(0, 1, 0) ) | List(false, true, false) |
ToBoolean( List(0.000001, 2, 0) ) | List(true, true, false) |
ToBoolean( List(0, -123) ) | List(false, true) |