Conversion Filters

base64_decode: Decodes the value represented as base64 and returns the result.

Example: we have a text value of aGVsbG8gd29ybGQ= using the filter base64_decode we get hello world.

base64_encode: Encodes the value and returns the result as base64 text.

Example: we have a text value of hello world using the filter base64_encode we get aGVsbG8gd29ybGQ= .

json_decode: Decodes the value represented as json and returns the result. We will decode the json from the json_encode filter example.

In this example, the variable json2 becomes: { "a":"3", "b":"2", "c":"1" }.

json_encode: Encodes the value and returns the result as json text. The variable object is: { "a":"3", "b":"2", "c":"1" }.

In this example, the variable json becomes: {\"a\":\"3\",\"b\":\"2\",\"c\":\"1\"}.

to_bool: Converts text, integer, or decimal types to a bool and returns the result. The different conversions that are possible with this filter are: Converting a text/integer/decimal value of 0 to false. Converting a text/integer/decimal value of 1 to true. Converting a text value of "true" to true. Converting a text value of "false" to false.

Example: we have a text value of 0 by using the to_bool filter the variable becomes false.

to_decimal: Converts text, integer, or bool types to a decimal and returns the result.

Example: we have a text value of 5.76 by using the to_decimal filter the variable becomes a dec= 5.76.

to_int: Converts text, decimal, or bool types to an integer and returns the result.

Example: we have a text value of 5.76 by using the to_int filter the variable becomes an int= 5

to_text: Converts text, decimal, or bool types to text and returns the result.

Example: we have a decimal value of 5.76 by using the to_text filter the variable becomes a text= 5.76

to_timestamp: Converts a text expression (now, next Friday) to timestamp comparable format.

Example: we have a text value of now by using the to_timestamp filter the variable becomes 1593204483394.

url_decode: Decodes the value represented as a URL encoded value.

Example: we have a text value then use the url_decode filter to change it to Hello World & Xano.

url_encode: Encodes the value and returns the result as a URL encoded value.

Example: we have a text value then use the url_encode filter to change it to Hello+World+%26+Xano.

yaml_decode: Decodes the value represented as yaml and returns the result. For this example, we will use the example from yaml encode and then decode the variable. The variable gets changed into:

{
"name": "John",
"age": 30,
"car": "ford"
}

yaml_encode: Encodes the value and returns the result as yaml text.

This returns the variable as name: John age: 30 car: ford

​