List of Functions
GENERAL FUNCTIONS
CONCAT(value1, [value2, ...]
Example: CONCAT(item.width, 'px')
Summary:
Returns the concatenation of values.
value1
The value to which value2 will be appended
value2 – optional, repeatable
The value to append to value1
FORMAT(template, [argument1, ...]
Examples:
FORMAT('{0} of {1}', item.number, data.total)
FORMAT('{} of {}', item.number, data.total)
Summary:
Returns string with arguments inserted into template placeholders.
template
Template with placeholders for arguments
argument1: – optional, repeatable
The value to insert into template placeholder
CONTAINS(object, value, [caseInsensitive])
Examples:
text
Summary:
text
value1
text
value2 – optional, repeatable
text
SIZE(value)
Example:
SIZE(item.apartments)
Summary:
Returns the number of values in a dataset
value
Dataset (array) of values
NUMBER_FORMAT(value, [format], [fraction])
Examples:
NUMBER_FORMAT(item.amount, 'metric_prefix')
NUMBER_FORMAT(item.price, 'currency', 2)
NUMBER_FORMAT(item.complete, 'percentage')
NUMBER_FORMAT(item.order, 'order')
NUMBER_FORMAT(item.size, 'file_size', 2)
NUMBER_FORMAT(item.amplitude, 'exponential', 4)
Summary:
Returns string representation of number using given format
value
Number value
format – optional
metric_prefix, currency, percentage, order, file_size, or exponential
fraction - optional
Max fractional part, default is 2
EMPTY(value)
Example:
EMPTY(item.apartments)
Summary:
Returns if the value is empty
value
Dataset (array) of values or string
GET(object, property, default_value)
Examples:
GET(record, 'first_name', 'no name')
Summary:
Returns property from object
object
Object with properties
property
Property name you want to extract
default_value
Value that will be returned if property not found
ANY(value1, [value2, ...])
Example:
ANY(item.title1, item.title2)
Summary:
Returns first value which is not empty, null or undefined
value1
The first value to return from
value2 – optional, repeatable
Additional values to return from
STRING(value)
Example:
STRING(12.34)
Summary:
Returns value as string
value
Any value that needs to be transformed to a string
NUMBER(value)
Example:
NUMBER('12.34')
Summary:
Returns value as number
value
Any value that needs to be transformed to a string
JSON(value)
Example:
JSON('{"foo":"bar"}')
Summary:
Returns JSON string value as object to extract data
value
JSON formatted string
HASH(length)
Example:
HASH(32)
Summary:
Returns a random hash with the specified length
length
The length of the hash
RANDOM(low, high)
Example:
RANDOM(1, 10)
Summary:
Returns a uniformly random integer between two values, inclusive
low
The low end of the random range
high
The high end of the random range
MAP(value, func)
Example:
func(x) = {"foo": x}; MAP([4, 3, 1, 5], func)
Summary:
Mapped database {array} using provided function
value
The dataset to be mapped
func
Function for mapping 1 item
FILTER(value, func)
Example:
func(x) = x >= 2; FILTER([4, 3, 1, 5], func)
Summary:
Filtered dataset (array) using provided function
value
The dataset to be filtered
func
Function for filtering 1 item
UPPER(value)
Example:
UPPER('English')
Summary:
Returns value in uppercase
value
A string that needs to be converted to uppercase
LOWER(value)
Example:
LOWER('English')
Summary:
Returns value in lowercase
value
A string that needs to be converted to lowercase
TITLE_CASE(value)
Example:
TITLE_CASE('English')
Summary:
Returns value in titlecase
value
A string that needs to be converted to titlecase
SLUGIFY(value, [separator])
Examples:
SLUGIFY('Top 10 places to visit')
SLUGIFY('Top 10 places to visit', '-')
Summary:
Returns value as human-readable keywords
value
Any value that needs to be transformed to a slug
separator – optional
Symbol which separates words
LOGICAL FUNCTIONS
IF(logical_expression, value_if_true, value_if_false)
Example:
IF(item.approved, 'Approved', 'Not approved')
Summary:
Returns one value if a logical expression is TRUE and another if it is FALSE
logical_expression
An expression or variable containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value
value_if_true
The value the function returns if logical expression is TRUE
value_if_false
The value the function returns if logical_expression is FALSE
EQ(value1, value2)
Example:
EQ(1, 2)
Summary:
Returns TRUE if two specified values are equal and FALSE otherwise
value1
The first value
value2
The value to test against value1 for equality
AND(logical_expression1, logical_expression2)
Example:
AND(item.approved, NOT(item.processed))
Summary:
Returns TRUE if all of the provided arguments are logically true, and FALSE if any of the provided arguments are logically false
logical_expression1
An expression or variable containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value
logical_expression2
More expressions that represent logical values
NOT(logical_expression)
Example:
NOT(item.processed)
Summary:
Returns the opposite of a logical value - NOT(TRUE) returns FALSE, NOT(FALSE) returns TRUE
logical_expression
An expression or variable holding an expression that represents some logical value
XOR(logical_expression1, logical_expression2)
Example:
XOR(item.approved, item.processed)
Summary:
Returns TRUE if an odd number of the provided arguments are logically true and FALSE, if an even number of the arguments are logically true
logical_expression1
An expression or variable containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value
logical_expression2 – repeatable
More expressions that represent logical values
MATHEMATICAL FUNCTIONS
ROUND(value, [places])
Examples:
ROUND(2, 35)
ROUND(2, 35, 1)
Summary:
Rounds a number to a certain number of decimal places according to standard rules
value
The value to round to places number of places
places - optional
The number of decimal places to which to round
CEIL(value, [factor])
Examples:
CEIL(2.26)
CEIL(2.26, 0.01)
Summary:
Rounds a number up to the nearest integer multiple of specified significance factor
value1
The value to round up to the nearest integer multiple of factor
factor – optional
The number to the multiples of which the value will be rounded
FLOOR(value, [factor])
Examples:
FLOOR(2.56)
FLOOR(2.56, 0.1)
Summary:
Rounds a number down to the nearest integer multiple of specified significance factor
value
The value to round down to the nearest integer multiple of factor
factor – optional
The number to the multiples of which the value will be rounded
POW(base, exponent)
Example:
POW(2, item.length)
Summary:
Returns a number raised to a power
base
The number to raise to the exponent power
exponent
The exponent to raise the base to
LOG(value, [base])
Example:
LOG(8, 2)
Summary:
Returns the logarithm of a number with respect to a base
value
The value for which to calculate the logarithm
base - optional
The base to use for the calculation of the logarithm, default is 10
EXP(exponent)
Example:
EXP(8)
Summary:
Returns Euler's number, e (-2.718) raised to a power
exponent
the exponent to raise e to
ABS(value)
Example:
ABS(-3)
Summary:
Returns the absolute value of a number
value
The number of which to return the absolute value
SQRT(value)
Example:
SQRT(16)
Summary:
Returns the positive square root of a positive number
value
The number for which to calculate the positive square root
FIX(number, places)
Example:
FIX(3.14159265, 2)
Summary:
Formats a number with a fixed number of decimal places
number
The number to format
places
The number of decimal places to display in the result
MIN(value1, [value2, ...])
Example:
MIN(item.discount, 0.15)
Summary:
Returns the minimum value in a numeric dataset
value1
The first value or range to consider when calculating the minimum value
value2 – optional, repeatable
Additional values or ranges to consider when calculating the minimum value
MAX(value1, [value2, ...])
Example:
MAX(item.events, 9999)
Summary:
Returns the maximum value in a numeric dataset
value1
The first value or range to consider when calculating the maximum value
value2 – optional, repeatable
Additional values or ranges to consider when calculating the maximum value
AVERAGE(value1, [value2, ...])
Example:
AVERAGE(item.morning, item.afternoon, item.evening)
Summary:
Returns the numerical average value of a dataset, ignoring text
value1
The first value or range to consider when calculating the average value
value2 – optional, repeatable
Additional values or ranges to consider when calculating the average value
SUM(value1, [value2, ...])
Example:
SUM(item.sold, item.reserved)
Summary:
Returns the sum of numbers
value1
The first number to add
value2 – optional, repeatable
Additional numbers to add to value1
There are also Date & Time functions and Permission functions.
Last updated