Learn how to use and combine different conversion functions in APL
Function Name | Description |
---|---|
dynamic_to_json | Converts a scalar value of type dynamic to a canonical string representation. |
ensure_field | Ensures the existence of a field and returns its value or a typed nil if it doesn’t exist. |
isbool | Returns a value of true or false if the expression value is passed. |
tobool | Converts input to boolean (signed 8-bit) representation. |
todatetime | Converts input to datetime scalar. |
todouble, toreal | Converts the input to a value of type real . todouble and toreal are synonyms. |
tohex | Converts input to a hexadecimal string. |
toint | Converts the input to an integer value (signed 64-bit) number representation. |
tolong | Converts input to long (signed 64-bit) number representation. |
tostring | Converts input to a string representation. |
totimespan | Converts input to timespan scalar. |
toarray | Converts input to array. |
todynamic | Converts input to dynamic. |
name | type | description |
---|---|---|
field_name | string | The name of the field to ensure exists. |
field_type | type | The type of the field. See scalar data types for supported types. |
show_field
is nil because the myfield
field doesn’t exist.
newstatus
is the value of status
because the status
field exists.
upcoming_field
that is expected to be added to the data soon. By using ensure_field()
, logic can be written around this future field, and the query will work when the field becomes available.
false
false.
real.
Expr:
Expression that will be converted to string.Expr:
Expression that will be converted to timespan.dynamic
to a canonical string
representation.
string
, according to the following rules:
dynamic
, the output is the app of tostring()
to that value.
true
if expression value is a bool, false
otherwise.
null
.