toboolean( value )
Converts a value to Boolean.
Keyword | Type | Description |
---|---|---|
|
Any Type |
Value to convert. |
Boolean
A 0
returns false
; all other numbers return true
.
Strings beginning with t
, T
, y
, Y
, or 1
return true
; all other strings return false
.
When operating on arrays, it is not necessary to use apply
with toboolean
. If multiple parameters are passed, or one parameter is an Array, then a Boolean Array is returned.
1
toboolean(0)
Returns false
.
1
toboolean("True")
Returns true
.
1
toboolean(null)
Returns null
.
1
toboolean(0,1,0,-1)
and
1
toboolean({0,1,0,-1})
Both return {false,true,false,true}
.
1
toboolean("Time", "tango", "true", "t", "T", "yes", "Yes", "Y", "y", "1", "S", "seven", "B", "0", "2", null)
Returns {true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, null}
.
1
toboolean({})
Returns an empty List of Boolean
.
1
2
3
4
5
6
7
8
9
toboolean(
{
a!map(key: "key1", value: true()),
a!map(key: "key2", value: false()),
a!map(key: "key3", value: 0),
a!map(key: "key4", value: 1),
a!map(key: "key5", value: "Y")
}.value
)
Returns {true, false, false, true, true}
.
1
2
3
4
5
6
7
toboolean(
{
a!map(key: "key1", value: true),
a!map(key: "key2", value: {true, false, true, false}),
a!map(key: "key3", value: null),
}.value
)
Returns {true, true, false, true, false, null}
.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible |
toboolean() Function