Conversions

PropertyExpressionDescription
Conversions
ToBinary(value)
Returns value, converted to encoded binary. Value can be of any type, except binary. For example, the following expression returns "0x6F006B00": ToBinary("ok")
Conversions
ToBoolean(value)
Returns value, converted to Boolean (1 or 0). Value must be one of the following: 1, 0, t, f, true, false, y, n, yes, no For example, the following expression returns 1: ToBoolean("Yes")
Conversions
ToDate(value)
Returns value, formatted as a standard date, provided value contains a valid date in a format that is recognised. For example, the following expression returns "2004-11-27": ToDate("2004-11-27 10:45pm")
Conversions
ToDateTime(value)
Returns value, formatted as a standard date and time, provided value contains a valid date or datetime in a format that is recognised. For example, the following expression returns "2004-11-27 22:45:00.0000000": ToDateTime("2004-11-27 10:45pm")
Conversions
ToNumber(value)
Returns value formatted as a number, provided value contains a valid number. This can be used when a text literal contains a number but might be treated as text unless we explicitly tell the system it’s a number. This also supports conversion from scientific notation. For example, the following expression returns "602200": ToNumber("6.022e5")
Conversions
ToText(value)
Returns the text representation of value. If value is valid encoded binary, then value will be decoded and returned as text. If the encoded data is not text, this may result in unexpected characters and text if you try to convert it to text. For example, the following expression returns "ok": ToText("0x6F006B00") For any other data type, the text representation of its value will be returned. For Boolean types, this means returning either "True" or "False". If value is a number, calling ToText will force it to be treated as text instead. This can be used when you want to treat a number as if it were text and perform concatenation rather than arithmetic using the ‘+’ operator. For example, the following expression returns "43": ToText(4) + 3
Conversions
ToTime(value)
Returns value, formatted as a standard time, provided value contains a valid time in a format that is recognised. For example, the following expression returns "22:45:00": ToTime("10:45pm")
Conversions
ToXML(value) ToXML(value, tagname)
Converts value to XML. This method works in one of two ways: If value is valid JSON, it is converted to XML and returned. Only the value parameter should be provided. If value contains an encoded binary representation of XML, the decoded XML is returned. Only the value parameter should be provided. If value contains any other type of data, a tagname should be provided. A single-node XML document is returned. For example, the following expression returns "<fox>brown</fox>": ToXML("brown", "fox") To build more complex XML, consider using the ToTemplate function.
Conversions
ToJSON(value)
Converts the XML in value to JSON format. This method only converts from XML to JSON. If value is valid XML, it is converted to JSON and returned. If value contains an encoded binary representation of JSON, the decoded JSON is returned. No other data types for value are allowed.