Skip to main content

Class: ExpressionMesPageContext

The base context for expressions executed (not within loops) such as for an email event within a loop

Hierarchy

Properties

timeZone

Readonly timeZone: undefined | null | string

Inherited from

ExpressionGlobalContext.timeZone

Accessors

dataSources

get dataSources(): ExpressionMesPageDataSources

Returns

ExpressionMesPageDataSources


device

get device(): ExpressionDevice

Returns

ExpressionDevice


documents

get documents(): ExpressionDocuments

Returns

ExpressionDocuments


ioInterfaces

get ioInterfaces(): ExpressionMesPageIOInterfaces

Returns

ExpressionMesPageIOInterfaces


media

get media(): ExpressionMedia

Returns

ExpressionMedia


offline

get offline(): boolean

Returns

boolean


site

get site(): ExpressionSite

Returns

ExpressionSite


user

get user(): ExpressionUser

Returns

ExpressionUser


variables

get variables(): KeyValues

Returns

KeyValues

Aggregate Functions Methods

ALL

ALL(criteria, ...values): boolean

Returns true if all values match the criteria

Example

ALL('a', 'a', 'b', 'c') = false

Example

ALL('a', 'a', 'a') = true

Parameters

NameTypeDescription
criteriaanyThe criteria to match
...valuesany[]The values to check against the criteria

Returns

boolean

True if all values match the criteria, false otherwise

Inherited from

ExpressionGlobalContext.ALL


ANY

ANY(criteria, ...values): boolean

Returns true if any of the values match the criteria

Example

ANY('a', 'a', 'b', 'c') = true

Parameters

NameTypeDescription
criteriaanyThe criteria to match
...valuesany[]The values to check against the criteria

Returns

boolean

True if any value matches the criteria, false otherwise

Inherited from

ExpressionGlobalContext.ANY


AVERAGE

AVERAGE(...values): number

Returns the average of the passed numbers

Example

AVERAGE(1, 2, 3) = 2

Parameters

NameTypeDescription
...values(null | NumberLike)[]The numbers to average, can be numbers or null

Returns

number

The average of the numbers, or null if all values are null

Inherited from

ExpressionGlobalContext.AVERAGE


COALESCE

COALESCE(...values): boolean

Returns the first non null value from the supplied values

Example

COALESCE(null, 'value', null) = 'value'

Example

COALESCE(null, null, null) = null

Example

COALESCE('value1', 'value2') = 'value1'

Parameters

NameTypeDescription
...valuesany[]The values to check

Returns

boolean

The first non null value, or null if all values are null

Inherited from

ExpressionGlobalContext.COALESCE


COUNT

COUNT(...values): number

Returns the count of non-null values from the passed values

Example

COUNT(1, 2, 3) = 3

Example

COUNT(1, null, 3) = 2

Parameters

NameTypeDescription
...valuesany[]The values to count, can be numbers, strings, or null

Returns

number

The count of non-null values, or 0 if all values are null

Inherited from

ExpressionGlobalContext.COUNT


COUNTIF

COUNTIF(criteria, ...values): number

Parameters

NameType
criteriaany
...valuesany[]

Returns

number

Inherited from

ExpressionGlobalContext.COUNTIF


DEFAULT

DEFAULT(value, defaultValue): boolean

Returns the defaultValue if the value is null

Example

DEFAULT(null, 'default') = 'default'

Parameters

NameTypeDescription
valueanyThe value to check
defaultValueanyThe value to return if the value is null

Returns

boolean

The value if it is not null, otherwise the defaultValue

Inherited from

ExpressionGlobalContext.DEFAULT


DIVIDE

DIVIDE(value, ...values): null | number

Returns the first number divided by the following numbers

Example

DIVIDE(10, 2, 5) = 1

Example

DIVIDE(10, null, 5) = 2

Parameters

NameTypeDescription
valuenull | NumberLikeThe first number to divide, can be a number or null
...values(null | NumberLike)[]The following numbers to divide by, can be numbers or null

Returns

null | number

The result of the division, or null if all values are null

Inherited from

ExpressionGlobalContext.DIVIDE


MAX

MAX(...values): number

Returns the maximum value from the passed numbers

Example

MAX(1, 2, 3) = 3

Parameters

NameTypeDescription
...values(null | NumberLike)[]The numbers to find the maximum of, can be numbers or null

Returns

number

The maximum value from the numbers, or null if all values are null

Inherited from

ExpressionGlobalContext.MAX


MIN

MIN(...values): number

Returns the minimum value from the passed numbers

Example

MIN(1, 2, 3) = 1

Parameters

NameTypeDescription
...values(null | NumberLike)[]The numbers to find the minimum of, can be numbers or null

Returns

number

The minimum value from the numbers, or null if all values are null

Inherited from

ExpressionGlobalContext.MIN


MULTIPLY

MULTIPLY(value, ...values): null | number

Returns the multiplication of the passed numbers

Example

MULTIPLY(2, 3, 4) = 24

Example

MULTIPLY(2, null, 4) = 8

Parameters

NameTypeDescription
valuenull | NumberLikeThe first number to multiply, can be a number or null
...values(null | NumberLike)[]The following numbers to multiply, can be numbers or null

Returns

null | number

The product of the numbers, or null if all values are null

Inherited from

ExpressionGlobalContext.MULTIPLY


SUBTRACT

SUBTRACT(...values): number

Returns the first number minus by the following numbers

Example

SUBTRACT(10, 2, 3) = 5

Example

SUBTRACT(10, null, 3) = 7

Parameters

NameTypeDescription
...values(null | NumberLike)[]The numbers to subtract, can be numbers or null

Returns

number

The result of the subtraction, or null if all values are null

Inherited from

ExpressionGlobalContext.SUBTRACT


SUM

SUM(...values): number

Returns the sum of the passed numbers

Example

SUM(1, 2, 3) = 6

Example

SUM(1, null, 3) = 4

Parameters

NameTypeDescription
...values(null | NumberLike)[]The numbers to sum, can be numbers or null

Returns

number

The sum of the numbers, or null if all values are null

Inherited from

ExpressionGlobalContext.SUM


Array Functions Methods

AT

AT(index, ...values): number

Returns the item at the specified index in the array (zero based)

Example

AT(0, 1, 2, 3) = 1

Example

AT(2, 1, 2, 3) = 3

Parameters

NameTypeDescription
indexnumberThe index of the item to return, zero based
...valuesany[]The values to get the item from, can be numbers, strings, or null

Returns

number

The item at the specified index, or null if the index is out of bounds or all values are null

Inherited from

ExpressionGlobalContext.AT


CELLLOOKUP

CELLLOOKUP(rows, lookupCol, lookupValue, outputCol): any

Returns the value of the outputCol for the first row where the lookupCol has the lookupValue

Parameters

NameType
rowsany[]
lookupColstring
lookupValuestring
outputColstring

Returns

any

Inherited from

ExpressionGlobalContext.CELLLOOKUP


FIRST

FIRST(...values): number

Returns the first item in an array of values

Example

FIRST(1, 2, 3) = 1

Example

FIRST(null, 2, 3) = 2

Parameters

NameTypeDescription
...valuesany[]The values to get the first item from, can be numbers, strings, or null

Returns

number

The first item from the values, or null if all values are null

Inherited from

ExpressionGlobalContext.FIRST


LAST

LAST(...values): number

Returns the last item in an array of values

Example

LAST(1, 2, 3) = 3

Example

LAST(1, 2, null) = 2

Parameters

NameTypeDescription
...valuesany[]The values to get the last item from, can be numbers, strings, or null

Returns

number

The last item from the values, or null if all values are null

Inherited from

ExpressionGlobalContext.LAST


LOOKUP

LOOKUP(key, criteria, ...values): any

Returns the first object which matches the lookup from an array objects

Parameters

NameType
keystring
criteriastring
...valuesany[]

Returns

any

Inherited from

ExpressionGlobalContext.LOOKUP


SELECT

SELECT(data, ...fields): null | any[]

Returns the specified fields from the data array as a new array of objects

Parameters

NameType
dataany[]
...fields(string | [string, string])[]

Returns

null | any[]

Inherited from

ExpressionGlobalContext.SELECT


SELECTPROPERTY

SELECTPROPERTY(data, field): null | any[]

Returns an array of the specified field from the data array

Example

SELECTPROPERTY([{name: 'John'}, {name: 'Jane'}], 'name') = ['John', 'Jane']

Parameters

NameTypeDescription
dataany[]The array of objects to select from
fieldstringThe field to select from each object in the array

Returns

null | any[]

An array of the specified field from each object in the data array

Inherited from

ExpressionGlobalContext.SELECTPROPERTY


Comparison Functions Methods

BETWEEN

BETWEEN(value, minValue, maxValue): boolean

Returns true if value is between minValue and maxValue (inclusive)

Parameters

NameTypeDescription
valueanyThe value to check
minValueanyThe minimum value
maxValueanyThe maximum value

Returns

boolean

Boolean indicating if value is between minValue and maxValue

Inherited from

ExpressionGlobalContext.BETWEEN


EQUALS

EQUALS(value1, value2): boolean

Compares two values and returns true if they are equal or equivelent This function is used to compare values in expressions and is not the same as the JavaScript === operator For example, EQUALS(1, '1') will return true

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if the two values are equal

Inherited from

ExpressionGlobalContext.EQUALS


GT

GT(value1, value2): boolean

Returns true if value1 is greater than value2

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if value1 is greater than value2

Inherited from

ExpressionGlobalContext.GT


GTE

GTE(value1, value2): boolean

Returns true if value1 is greater than or equal to value2

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if value1 is greater than or equal to value2

Inherited from

ExpressionGlobalContext.GTE


ISEMPTY

ISEMPTY(value): boolean

Returns true is the value is empty/blank

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.ISEMPTY


ISFALSE

ISFALSE(value): boolean

Returns true is the value is false

Parameters

NameType
valueBooleanLike

Returns

boolean

Inherited from

ExpressionGlobalContext.ISFALSE


ISNEGATIVE

ISNEGATIVE(value): boolean

Returns true is the value is less than 0

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.ISNEGATIVE


ISPOSITIVE

ISPOSITIVE(value): boolean

Returns true is the value is greater than 0

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.ISPOSITIVE


ISTRUE

ISTRUE(value): boolean

Returns true is the value is true

Parameters

NameType
valueBooleanLike

Returns

boolean

Inherited from

ExpressionGlobalContext.ISTRUE


ISZERO

ISZERO(value): boolean

Returns true is the value is 0

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.ISZERO


LT

LT(value1, value2): boolean

Returns true if value1 is less than value2

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if value1 is less than value2

Inherited from

ExpressionGlobalContext.LT


LTE

LTE(value1, value2): boolean

Returns true if value1 is less than or equal to value2

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if value1 is less than or equal to value2

Inherited from

ExpressionGlobalContext.LTE


NOTEMPTY

NOTEMPTY(value): boolean

Returns true is the value is not empty/blank

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.NOTEMPTY


NOTEQUALS

NOTEQUALS(value1, value2): boolean

Compares two values and returns true if they are not equal or equivelent This function is used to compare values in expressions and is not the same as the JavaScript !== operator For example, NOTEQUALS(1, '1') will return false

Parameters

NameTypeDescription
value1anyFirst value to compare
value2anySecond value to compare

Returns

boolean

Boolean indicating if the two values are not equal

Inherited from

ExpressionGlobalContext.NOTEQUALS


Date Functions Methods

ADDDAYS

ADDDAYS(date, amount): null | Date

Adds the specified number of days to the given date.

Parameters

NameType
datenull | DateLike
amountnull | NumberLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.ADDDAYS


ADDHOURS

ADDHOURS(date, amount): null | Date

Adds the specified number of hours to the given date.

Parameters

NameType
datenull | DateLike
amountnull | NumberLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.ADDHOURS


ADDMINUTES

ADDMINUTES(date, amount): null | Date

Adds the specified number of minutes to the given date.

Parameters

NameType
datenull | DateLike
amountnull | NumberLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.ADDMINUTES


ADDMONTHS

ADDMONTHS(date, amount): null | Date

Adds the specified number of months to the given date.

Example

ADDMONTHS('2023-01-01', 2) = new Date('2023-03-01')

Parameters

NameTypeDescription
datenull | DateLikeThe date to add months to, can be a Date object or a string in ISO format
amountnull | NumberLikeThe number of months to add, can be a positive or negative integer

Returns

null | Date

A new Date object with the specified number of months added, or null if the input date is null

Inherited from

ExpressionGlobalContext.ADDMONTHS


ADDSECONDS

ADDSECONDS(date, amount): null | Date

Adds the specified number of seconds to the given date.

Parameters

NameType
datenull | DateLike
amountnull | NumberLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.ADDSECONDS


ADDWEEKS

ADDWEEKS(date, amount): null | Date

Adds the specified number of weeks to the given date.

Parameters

NameType
datenull | DateLike
amountnull | NumberLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.ADDWEEKS


ADDYEARS

ADDYEARS(date, amount): null | Date

Adds the specified number of years to the given date.

Example

ADDYEARS('2023-01-01', 2) = new Date('2025-01-01')

Parameters

NameTypeDescription
datenull | DateLikeThe date to add years to, can be a Date object or a string in ISO format
amountnull | NumberLikeThe number of years to add, can be a positive or negative integer

Returns

null | Date

A new Date object with the specified number of years added, or null if the input date is null

Inherited from

ExpressionGlobalContext.ADDYEARS


DAY

DAY(date): null | number

Returns the day component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the day from, can be a Date object or a string in ISO format

Returns

null | number

The day component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.DAY


DIFFDAYS

DIFFDAYS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of days difference e.g. DIFFDAYS('2023-01-05', '2023-01-01') = 4

Example

DIFFDAYS('2023-01-05', '2023-01-01') = 4

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of days difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFDAYS


DIFFHOURS

DIFFHOURS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of hours difference e.g. DIFFHOURS('2023-01-01 05:01:01', '2023-01-01 00:00:00') = 5

Example

DIFFHOURS('2023-01-01 05:01:01', '2023-01-01 00:00:00') = 5

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of hours difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFHOURS


DIFFMINUTES

DIFFMINUTES(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of minutes difference e.g. DIFFMINUTES('2023-01-01 00:01:02', '2023-01-01 00:00:00') = 1

Example

DIFFMINUTES('2023-01-01 00:01:02', '2023-01-01 00:00:00') = 1

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of minutes difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFMINUTES


DIFFMONTHS

DIFFMONTHS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of months difference e.g. DIFFMONTHS('2023-03-05', '2023-01-01') = 2

Example

DIFFMONTHS('2023-03-05', '2023-01-01') = 2

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of months difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFMONTHS


DIFFSECONDS

DIFFSECONDS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of seconds difference e.g. DIFFSECONDS('2023-01-01 00:01:02', '2023-01-01 00:00:00') = 62

Example

DIFFSECONDS('2023-01-01 00:01:02', '2023-01-01 00:00:00') = 62

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of seconds difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFSECONDS


DIFFTIME

DIFFTIME(endDate, startDate): null | string

Subtracts the second date from the first date and returns the time diff in the format [days].HH.MM:SS

Example

DIFFTIME('2023-01-01 00:01:02', '2023-01-01 00:00:00') = '0.00.01:02'

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | string

The time difference between the two dates in the format [days].HH.MM:SS, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFTIME


DIFFWEEKS

DIFFWEEKS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of weeks difference e.g. DIFFWEEKS('2023-01-01', '2023-01-17') = 2

Example

DIFFWEEKS('2023-01-01', '2023-01-17') = 2

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of weeks difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFWEEKS


DIFFYEARS

DIFFYEARS(endDate, startDate): null | number

Subtracts the second date from the first date and returns the number of years difference e.g. DIFFYEARS('2025-01-05', '2023-01-01') = 2

Example

DIFFYEARS('2025-01-05', '2023-01-01') = 2

Parameters

NameTypeDescription
endDatenull | DateLikeThe end date to subtract from, can be a Date object or a string in ISO format
startDatenull | DateLikeThe start date to subtract, can be a Date object or a string in ISO format

Returns

null | number

The number of years difference between the two dates, or null if either date is null

Inherited from

ExpressionGlobalContext.DIFFYEARS


ENDOFDAY

ENDOFDAY(date): null | Date

Returns the end of the day for a given date and time

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the end of day for, can be a Date object or a string in ISO format

Returns

null | Date

The end of day date, or null if the input date is null

Inherited from

ExpressionGlobalContext.ENDOFDAY


HOURS

HOURS(date): null | number

Returns the hour component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the hour from, can be a Date object or a string in ISO format

Returns

null | number

The hour component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.HOURS


ISAFTER

ISAFTER(date, dateToCompare): boolean

Returns true if the first date is after the second one

Example

ISAFTER('2023-01-02', '2023-01-01') = true

Parameters

NameTypeDescription
dateDateLikeThe date to compare
dateToCompareDateLikeThe date to compare against

Returns

boolean

True if the first date is after the second date, false otherwise

Inherited from

ExpressionGlobalContext.ISAFTER


ISBEFORE

ISBEFORE(date, dateToCompare): boolean

Returns true if the first date is before the second one

Example

ISBEFORE('2023-01-01', '2023-01-02') = true

Parameters

NameTypeDescription
dateDateLikeThe date to compare
dateToCompareDateLikeThe date to compare against

Returns

boolean

True if the first date is before the second date, false otherwise

Inherited from

ExpressionGlobalContext.ISBEFORE


ISDATE

ISDATE(value): boolean

Returns true if the value is a valid date, false otherwise

Parameters

NameTypeDescription
valueanyThe value to check if it is a date

Returns

boolean

True if the value is a valid date, false otherwise

Inherited from

ExpressionGlobalContext.ISDATE


ISFUTURE

ISFUTURE(date): boolean

Returns true if the date is in the future

Parameters

NameTypeDescription
dateDateLikeThe date to check

Returns

boolean

True if the date is in the future, false otherwise

Inherited from

ExpressionGlobalContext.ISFUTURE


ISPAST

ISPAST(date): boolean

Returns true if the date is in the past

Parameters

NameTypeDescription
dateDateLikeThe date to check

Returns

boolean

True if the date is in the past, false otherwise

Inherited from

ExpressionGlobalContext.ISPAST


JULIANDAY

JULIANDAY(date): null | number

Returns the Julian day number for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the Julian day number for, can be a Date object or a string in ISO format

Returns

null | number

The Julian day number, or null if the date is null

Inherited from

ExpressionGlobalContext.JULIANDAY


LOCALTOUTC

LOCALTOUTC(date): null | Date

Converts a local date to a UTC date based on the time zone set in the context

Parameters

NameTypeDescription
datenull | DateLikeThe local date to convert, can be a Date object or a string in ISO format

Returns

null | Date

The UTC date, or null if the input date is null

Inherited from

ExpressionGlobalContext.LOCALTOUTC


MAXDATE

MAXDATE(...values): Date

Returns the latest of the given dates.

Example

MAXDATE('2023-01-01', '2023-01-02') = new Date('2023-01-02')

Example

MAXDATE('2023-01-01', '2023-01-02', '2023-01-03') = new Date('2023-01-03')

Example

MAXDATE(null, '2023-01-02', null) = new Date('2023-01-02')

Parameters

NameTypeDescription
...values(null | DateLike)[]The dates to compare, can be Date objects or strings in ISO format

Returns

Date

The latest date from the provided values, or null if all values are null

Inherited from

ExpressionGlobalContext.MAXDATE


MINDATE

MINDATE(...values): Date

Returns the earliest of the given dates.

Example

MINDATE('2023-01-01', '2023-01-02') = new Date('2023-01-01')

Example

MINDATE('2023-01-01', '2023-01-02', '2023-01-03') = new Date('2023-01-01')

Example

MINDATE(null, '2023-01-02', null) = new Date('2023-01-02')

Parameters

NameTypeDescription
...values(null | DateLike)[]The dates to compare, can be Date objects or strings in ISO format

Returns

Date

The earliest date from the provided values, or null if all values are null

Inherited from

ExpressionGlobalContext.MINDATE


MINUTES

MINUTES(date): null | number

Returns the minutes component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the minutes from, can be a Date object or a string in ISO format

Returns

null | number

The minutes component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.MINUTES


MONTH

MONTH(date): null | number

Returns the month component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the month from, can be a Date object or a string in ISO format

Returns

null | number

The month component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.MONTH


NOW

NOW(): Date

Returns the current date and time

Returns

Date

Inherited from

ExpressionGlobalContext.NOW


PARSEDATE

PARSEDATE(date): null | Date

Converts a value into a date object

Parameters

NameTypeDescription
datenull | DateLikeThe value to convert into a date, can be a string in ISO format or a Date object

Returns

null | Date

A Date object representing the parsed date, or null if the input is null

Inherited from

ExpressionGlobalContext.PARSEDATE


PARSEDATEANDTIME

PARSEDATEANDTIME(date, time): null | Date

Parses a date and time string into a Date object

Example

PARSEDATEANDTIME('2023-01-01', '12:00:00') = new Date('2023-01-01T12:00:00Z')

Parameters

NameTypeDescription
dateDateLikeThe date to parse, can be a string or Date object
timestringThe time to parse, can be a string in the format HH:MM:SS

Returns

null | Date

A Date object representing the parsed date and time, or null if parsing fails

Inherited from

ExpressionGlobalContext.PARSEDATEANDTIME


SECONDS

SECONDS(date): null | number

Returns the seconds component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the seconds from, can be a Date object or a string in ISO format

Returns

null | number

The seconds component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.SECONDS


SECONDSTOTIME

SECONDSTOTIME(seconds): null | string

Converts a number of seconds into a time string in the format HH:MM:SS

Example

SECONDSTOTIME(3661) = '01:01:01'

Example

SECONDSTOTIME(1800) = '00:30:00'

Parameters

NameTypeDescription
secondsnull | numberThe number of seconds to convert, can be a number or null

Returns

null | string

A time string in the format HH:MM:SS representing the input seconds, or null if the input is null

Inherited from

ExpressionGlobalContext.SECONDSTOTIME


STARTOFDAY

STARTOFDAY(date): null | Date

Returns the start of the day for a given date and time

Parameters

NameType
datenull | DateLike

Returns

null | Date

Inherited from

ExpressionGlobalContext.STARTOFDAY


SUBTIMES

SUBTIMES(time1, time2): null | string

Subtracts the second time string from the first time string in the format HH:MM:SS and returns the result as a time string in the same format

Example

SUBTIMES('02:00:00', '01:30:00') = '00:30:00'

Example

SUBTIMES('01:00:00', '00:45:00') = '00:15:00'

Parameters

NameTypeDescription
time1null | stringThe first time string, can be in the format HH:MM:SS or null
time2null | stringThe second time string to subtract from the first, can be in the format HH:MM:SS or null

Returns

null | string

A time string in the format HH:MM:SS representing the result of the subtraction, or null if either input is null

Inherited from

ExpressionGlobalContext.SUBTIMES


SUMTIMES

SUMTIMES(...times): null | string

Sums multiple time strings in the format HH:MM:SS and returns the total as a time string in the same format

Example

SUMTIMES('01:00:00', '02:30:00', '00:45:00') = '04:15:00'

Example

SUMTIMES('00:30:00', '00:45:00') = '01:15:00'

Example

SUMTIMES(null, '01:00:00', null) = '01:00:00'

Parameters

NameTypeDescription
...times(null | string)[]The time strings to sum, can be in the format HH:MM:SS or null

Returns

null | string

A time string in the format HH:MM:SS representing the total sum of the input times, or null if all inputs are null

Inherited from

ExpressionGlobalContext.SUMTIMES


TIMETOSECONDS

TIMETOSECONDS(time): null | number

Converts a time string in the format HH:MM:SS to the total number of seconds

Example

TIMETOSECONDS('01:01:01') = 3661

Example

TIMETOSECONDS('00:30:00') = 1800

Parameters

NameTypeDescription
timenull | stringThe time string to convert, can be in the format HH:MM:SS or null

Returns

null | number

The total number of seconds represented by the time string, or null if the input is null

Inherited from

ExpressionGlobalContext.TIMETOSECONDS


TODAY

TODAY(): Date

Returns the start of the current day

Returns

Date

Inherited from

ExpressionGlobalContext.TODAY


UTCTOLOCAL

UTCTOLOCAL(date): null | Date

Converts a UTC date to a local date based on the time zone set in the context

Parameters

NameTypeDescription
datenull | DateLikeThe UTC date to convert, can be a Date object or a string in ISO format

Returns

null | Date

The local date, or null if the input date is null

Inherited from

ExpressionGlobalContext.UTCTOLOCAL


WEEK

WEEK(date, weekStartsOn?): null | number

Returns the week of the year of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the year from, can be a Date object or a string in ISO format
weekStartsOn?WeekdayLike-

Returns

null | number

The year component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.WEEK


YEAR

YEAR(date): null | number

Returns the year component of a date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the year from, can be a Date object or a string in ISO format

Returns

null | number

The year component of the date, or null if the date is null

Inherited from

ExpressionGlobalContext.YEAR


Logical Functions Methods

IF

IF(logicalTest, valueIfTrue, valueIfFalse): any

Parameters

NameType
logicalTestany
valueIfTrueany
valueIfFalseany

Returns

any

Inherited from

ExpressionGlobalContext.IF


SWITCH

SWITCH(valueToSwitch, valuesToMatchAndReturn, defaultValue?): any

Returns a value based on a value Example: SWITCH('g', [['r','Red'], ['g','Green'], ['b','Blue']], 'Other') = 'Green'

Argument

valueToSwitch The input value

Argument

valuesToMatchAndReturn An array of key value pairs to match with the valueToSwitch and return

Parameters

NameType
valueToSwitchany
valuesToMatchAndReturn[any, any][]
defaultValue?any

Returns

any

Inherited from

ExpressionGlobalContext.SWITCH


Math Functions Methods

ABS

ABS(number): null | number

Returns the absolute value of a number. The absolute value of a number is the number without its sign.

Example

ABS(-5) = 5

Example

ABS(5) = 5

Parameters

NameTypeDescription
numbernull | NumberLikeThe number to get the absolute value of, can be a number or null

Returns

null | number

The absolute value of the number, or null if the input is null

Inherited from

ExpressionGlobalContext.ABS


CEILING

CEILING(number): null | number

Rounds a number up to a whole number

Example

CEILING(5.2) = 6

Example

CEILING(5.8) = 6

Parameters

NameTypeDescription
numbernull | NumberLikeThe number to round up, can be a number or null

Returns

null | number

The rounded up number, or null if the input is null

Inherited from

ExpressionGlobalContext.CEILING


FLOOR

FLOOR(number): null | number

Rounds a number down to a whole number

Example

FLOOR(5.2) = 5

Example

FLOOR(5.8) = 5

Parameters

NameTypeDescription
numbernull | NumberLikeThe number to round down, can be a number or null

Returns

null | number

The rounded down number, or null if the input is null

Inherited from

ExpressionGlobalContext.FLOOR


ISNUMERIC

ISNUMERIC(number): boolean

Returns true if the value is a valid number

Example

ISNUMERIC(5) = true

Example

ISNUMERIC('5') = true

Example

ISNUMERIC('abc') = false

Parameters

NameTypeDescription
numberanyThe value to check if it is numeric, can be a number, string, or null

Returns

boolean

True if the value is numeric, false otherwise

Inherited from

ExpressionGlobalContext.ISNUMERIC


ROUND

ROUND(number, numberOfDigits?): null | number

Rounds a value to the nearest whole number or number of decimal places if specified

Example

ROUND(5.2) = 5

Example

ROUND(5.8) = 6

Example

ROUND(5.12345, 2) = 5.12

Example

ROUND(5.6789, 3) = 5.679

Parameters

NameTypeDescription
numbernull | NumberLikeThe number to round, can be a number or null
numberOfDigits?numberThe number of decimal places to round to, defaults to 0 (whole number)

Returns

null | number

The rounded number, or null if the input is null

Inherited from

ExpressionGlobalContext.ROUND


Other Methods

DAYOFWEEK

DAYOFWEEK(date, weekStartsOn?): null | number

Returns the day of the week for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the day of the week for, can be a Date object or a string in ISO format
weekStartsOn?WeekdayLikeThe day of the week to start counting from, can be a number (0-6) or a string representing the day (e.g. 'SUNDAY', 'MONDAY', etc.). Defaults to 0 (Sunday).

Returns

null | number

The day of the week as a number (0-6), or null if the date is null. 0 represents Sunday, 1 represents Monday, and so on.

Inherited from

ExpressionGlobalContext.DAYOFWEEK


DECODEFIELD

DECODEFIELD(data, field, decoder?): Promise<any>

Parameters

NameType
datastring
fieldstring
decoder?string

Returns

Promise<any>


ENDOFMONTH

ENDOFMONTH(date): null | Date

Returns the end of the month for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the end of month for, can be a Date object or a string in ISO format

Returns

null | Date

The end of month date, or null if the input date is null

Inherited from

ExpressionGlobalContext.ENDOFMONTH


ENDOFWEEK

ENDOFWEEK(date, weekStartsOn?): null | Date

Returns the end of the week for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the end of the week for, can be a Date object or a string in ISO format
weekStartsOn?WeekdayLikeThe day of the week to start counting from, can be a number (0-6) or a string representing the day (e.g. 'SUNDAY', 'MONDAY', etc.). Defaults to 0 (Sunday).

Returns

null | Date

The end of the week as a Date object, or null if the date is null. The returned date will be the last day of the week based on the specified weekStartsOn value.

Inherited from

ExpressionGlobalContext.ENDOFWEEK


STARTOFMONTH

STARTOFMONTH(date): null | Date

Returns the start of the month for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the start of month for, can be a Date object or a string in ISO format

Returns

null | Date

The start of month date, or null if the input date is null

Inherited from

ExpressionGlobalContext.STARTOFMONTH


STARTOFWEEK

STARTOFWEEK(date, weekStartsOn?): null | Date

Returns the start of the week for a given date

Parameters

NameTypeDescription
datenull | DateLikeThe date to get the start of the week for, can be a Date object or a string in ISO format
weekStartsOn?WeekdayLikeThe day of the week to start counting from, can be a number (0-6) or a string representing the day (e.g. 'SUNDAY', 'MONDAY', etc.). Defaults to 0 (Sunday).

Returns

null | Date

The start of the week as a Date object, or null if the date is null. The returned date will be the first day of the week based on the specified weekStartsOn value.

Inherited from

ExpressionGlobalContext.STARTOFWEEK


Text Functions Methods

FORMAT

FORMAT(value, format): string

Formats a value as a string using the specified format The format can be a date format, number format or a boolean format

Parameters

NameTypeDescription
valuestring | number | DateThe value to format, can be a string, number or date
formatstringThe format string, can be a date format, number format or a boolean format

Returns

string

The formatted string

Inherited from

ExpressionGlobalContext.FORMAT


ISEMAIL

ISEMAIL(value): boolean

Returns true is the value is a valid email address

Parameters

NameType
valuestring

Returns

boolean

Inherited from

ExpressionGlobalContext.ISEMAIL


JOIN

JOIN(seperator, ...values): string

Joins the values together with the seperator

Parameters

NameType
seperatorstring
...valuesany[]

Returns

string

Inherited from

ExpressionGlobalContext.JOIN


LEFT

LEFT(text, numberOfchars): string

Returns specified number of charachters the left hand side of a text string

Example

LEFT('Hello World', 5) = 'Hello'

Parameters

NameTypeDescription
textstringThe text to extract from
numberOfcharsnumberThe number of characters to extract

Returns

string

The leftmost characters of the text string

Inherited from

ExpressionGlobalContext.LEFT


LEN

LEN(text): number

Retruns the length of a text string

Parameters

NameType
textstring

Returns

number

Inherited from

ExpressionGlobalContext.LEN


LIKE

LIKE(value, like, caseSensitive?): boolean

Compare the value string to the like string and returns true if it is a match Case insensitve by default Wildcards: ? = Single character, # = Single number character, * = Zero or more characters,

Parameters

NameTypeDefault value
valuestringundefined
likestringundefined
caseSensitivebooleanfalse

Returns

boolean

Inherited from

ExpressionGlobalContext.LIKE


LOWER

LOWER(text): string

Converts a text string to lower case

Parameters

NameTypeDescription
textstringThe text to convert to lower case

Returns

string

The lower case version of the text

Inherited from

ExpressionGlobalContext.LOWER


MATCH

MATCH(value, pattern): boolean

Returns true if the value matches the pattern The pattern must contain a regular expression

Parameters

NameTypeDescription
valuestringThe string to match
patternstringThe regular expression pattern to match against

Returns

boolean

True if the value matches the whole pattern, false otherwise

Inherited from

ExpressionGlobalContext.MATCH


MID

MID(text, startFrom, numberOfchars): string

Retruns a section of a text string starting from the specified position

Parameters

NameTypeDescription
textstringThe text to extract from
startFromnumberThe position to start extracting from (1 based index)
numberOfcharsnumberThe number of characters to extract

Returns

string

The extracted section of the text

Inherited from

ExpressionGlobalContext.MID


NEWID

NEWID(): string

Retruns a globally unique identifier

Returns

string

A globally unique identifier

Inherited from

ExpressionGlobalContext.NEWID


NUMBERVALUE

NUMBERVALUE(text): null | number

Converts a text string to a number

Parameters

NameTypeDescription
textstringThe text to convert to a number

Returns

null | number

The number value of the text, or null if it cannot be converted *

Inherited from

ExpressionGlobalContext.NUMBERVALUE


PADEND

PADEND(value, length, filler): string

Returns a string padded with the specified filler to the end of the specified length If the value is longer than the length, it will be returned as is

Parameters

NameTypeDescription
valuestringThe string to pad
lengthnumberThe length to pad to
fillerstringThe string to pad with, defaults to a space

Returns

string

The padded string

Inherited from

ExpressionGlobalContext.PADEND


PADSTART

PADSTART(value, length, filler): string

Returns a string padded with the specified filler to the start of the specified length If the value is longer than the length, it will be returned as is

Parameters

NameTypeDescription
valuestringThe string to pad
lengthnumberThe length to pad to
fillerstringThe string to pad with, defaults to a space

Returns

string

The padded string

Inherited from

ExpressionGlobalContext.PADSTART


REPLACE

REPLACE(text, start, length, newText): string

Replaces a section of a text string with new text

Parameters

NameTypeDescription
textstringThe text to replace in
startanyThe position to start replacing from (1 based index)
lengthanyThe number of characters to replace
newTextanyThe text to replace with

Returns

string

The text with the specified section replaced

Inherited from

ExpressionGlobalContext.REPLACE


RIGHT(text, numberOfchars): string

Retruns specified number of charachters the right hand side of a text string

Example

RIGHT('Hello World', 5) = 'World'

Parameters

NameTypeDescription
textstringThe text to extract from
numberOfcharsnumberThe number of characters to extract

Returns

string

The rightmost characters of the text string

Inherited from

ExpressionGlobalContext.RIGHT


SPLIT

SPLIT(seperator, value): string[]

Splits a string into an array of strings using a seperator

Parameters

NameTypeDescription
seperatorstringThe string to split the value by
valuestringThe string to split

Returns

string[]

Inherited from

ExpressionGlobalContext.SPLIT


SUBSTITUTE

SUBSTITUTE(text, oldText, newText): string

Substitutes all instances of oldText in text with newText

Parameters

NameTypeDescription
textstringThe text to search in
oldTextstringThe text to replace
newTextstringThe text to replace with

Returns

string

The text with the oldText replaced by newText

Inherited from

ExpressionGlobalContext.SUBSTITUTE


TRIM

TRIM(value): string

Removes whitespace from both ends of a string

Parameters

NameTypeDescription
valueanyThe string to trim

Returns

string

The trimmed string

Inherited from

ExpressionGlobalContext.TRIM


TRIMEND

TRIMEND(value): string

Removes whitespace from the end of a string

Parameters

NameTypeDescription
valueanyThe string to trim

Returns

string

The trimmed string

Inherited from

ExpressionGlobalContext.TRIMEND


TRIMSTART

TRIMSTART(value): string

Removes whitespace from the start of a string

Parameters

NameTypeDescription
valueanyThe string to trim

Returns

string

The trimmed string

Inherited from

ExpressionGlobalContext.TRIMSTART


UPPER

UPPER(text): string

Converts a text string to upper case

Parameters

NameTypeDescription
textstringThe text to convert to upper case

Returns

string

The upper case version of the text

Inherited from

ExpressionGlobalContext.UPPER