Class: ExpressionMesWorkflowContext
The base context for expressions executed (not within loops) such as for an email event within a loop
Hierarchy
ExpressionGlobalContext↳
ExpressionMesWorkflowContext
Properties
_hasGetters
• _hasGetters: boolean = true
timeZone
• Readonly timeZone: undefined | null | string
Inherited from
ExpressionGlobalContext.timeZone
Accessors
calculations
• get calculations(): ExpressionMesWorkflowCalculations
Returns
ExpressionMesWorkflowCalculations
dataSources
• get dataSources(): ExpressionMesWorkflowDataSources
Returns
ExpressionMesWorkflowDataSources
documents
• get documents(): ExpressionDocuments
Returns
ExpressionDocuments
forms
• get forms(): ExpressionMesWorkflowForms
Returns
inputs
• get inputs(): ExpressionMesWorkflowInputs
Returns
media
• get media(): ExpressionMedia
Returns
ExpressionMedia
params
• get params(): KeyValues
Returns
KeyValues
site
• get site(): ExpressionSite
Returns
user
• get user(): ExpressionUser
Returns
Aggregate Functions Methods
ALL
▸ ALL(criteria, ...values): boolean
Parameters
| Name | Type |
|---|---|
criteria | any |
...values | any[] |
Returns
boolean
Inherited from
ExpressionGlobalContext.ALL
ANY
▸ ANY(criteria, ...values): boolean
Parameters
| Name | Type |
|---|---|
criteria | any |
...values | any[] |
Returns
boolean
Inherited from
ExpressionGlobalContext.ANY
AVERAGE
▸ AVERAGE(...values): number
Parameters
| Name | Type |
|---|---|
...values | (null | NumberLike)[] |
Returns
number
Inherited from
ExpressionGlobalContext.AVERAGE
COALESCE
▸ COALESCE(...values): boolean
Returns the first non null value from the supplied values
Parameters
| Name | Type |
|---|---|
...values | any[] |
Returns
boolean
Inherited from
ExpressionGlobalContext.COALESCE
COUNT
▸ COUNT(...values): number
Parameters
| Name | Type |
|---|---|
...values | any[] |
Returns
number
Inherited from
ExpressionGlobalContext.COUNT
COUNTIF
▸ COUNTIF(criteria, ...values): number
Parameters
| Name | Type |
|---|---|
criteria | any |
...values | any[] |
Returns
number
Inherited from
ExpressionGlobalContext.COUNTIF
DEFAULT
▸ DEFAULT(value, defaultValue): boolean
Returns the defaultValue if the value is null
Parameters
| Name | Type |
|---|---|
value | any |
defaultValue | any |
Returns
boolean
Inherited from
ExpressionGlobalContext.DEFAULT
DIVIDE
▸ DIVIDE(value, ...values): null | number
Returns the first number divided by the following numbers
Parameters
| Name | Type |
|---|---|
value | null | NumberLike |
...values | (null | NumberLike)[] |
Returns
null | number
Inherited from
ExpressionGlobalContext.DIVIDE
MAX
▸ MAX(...values): number
Parameters
| Name | Type |
|---|---|
...values | (null | NumberLike)[] |
Returns
number
Inherited from
ExpressionGlobalContext.MAX
MIN
▸ MIN(...values): number
Parameters
| Name | Type |
|---|---|
...values | (null | NumberLike)[] |
Returns
number
Inherited from
ExpressionGlobalContext.MIN
MULTIPLY
▸ MULTIPLY(value, ...values): null | number
Returns the multiplication of the passed numbers
Parameters
| Name | Type |
|---|---|
value | null | NumberLike |
...values | (null | NumberLike)[] |
Returns
null | number
Inherited from
ExpressionGlobalContext.MULTIPLY
SUBTRACT
▸ SUBTRACT(...values): number
Returns the first number minus by the following numbers
Parameters
| Name | Type |
|---|---|
...values | (null | NumberLike)[] |
Returns
number
Inherited from
ExpressionGlobalContext.SUBTRACT
SUM
▸ SUM(...values): number
Returns the sum of the passed numbers
Parameters
| Name | Type |
|---|---|
...values | (null | NumberLike)[] |
Returns
number
Inherited from
ExpressionGlobalContext.SUM
Array Functions Methods
AT
▸ AT(index, ...values): number
Returns the item at the specified index in the array (zero based)
Parameters
| Name | Type |
|---|---|
index | number |
...values | any[] |
Returns
number
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
| Name | Type |
|---|---|
rows | any[] |
lookupCol | string |
lookupValue | string |
outputCol | string |
Returns
any
Inherited from
ExpressionGlobalContext.CELLLOOKUP
FIRST
▸ FIRST(...values): number
Returns the first item in an array of values
Parameters
| Name | Type |
|---|---|
...values | any[] |
Returns
number
Inherited from
ExpressionGlobalContext.FIRST
LAST
▸ LAST(...values): number
Returns the last item in an array of values
Parameters
| Name | Type |
|---|---|
...values | any[] |
Returns
number
Inherited from
ExpressionGlobalContext.LAST
LOOKUP
▸ LOOKUP(key, criteria, ...values): any
Returns the first object which matches the lookup from an array objects
Parameters
| Name | Type |
|---|---|
key | string |
criteria | string |
...values | any[] |
Returns
any
Inherited from
ExpressionGlobalContext.LOOKUP
Date Functions Methods
ADDDAYS
▸ ADDDAYS(date, amount): null | Date
Adds the specified number of days to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDDAYS
ADDHOURS
▸ ADDHOURS(date, amount): null | Date
Adds the specified number of hours to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDHOURS
ADDMINUTES
▸ ADDMINUTES(date, amount): null | Date
Adds the specified number of minutes to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDMINUTES
ADDMONTHS
▸ ADDMONTHS(date, amount): null | Date
Adds the specified number of months to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDMONTHS
ADDSECONDS
▸ ADDSECONDS(date, amount): null | Date
Adds the specified number of seconds to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDSECONDS
ADDWEEKS
▸ ADDWEEKS(date, amount): null | Date
Adds the specified number of weeks to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDWEEKS
ADDYEARS
▸ ADDYEARS(date, amount): null | Date
Adds the specified number of years to the given date.
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
amount | null | number |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ADDYEARS
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | string
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
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
Parameters
| Name | Type |
|---|---|
endDate | null | DateLike |
startDate | null | DateLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.DIFFYEARS
ENDOFDAY
▸ ENDOFDAY(date): null | Date
Returns the end of the day for a given date and time
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | Date
Inherited from
ExpressionGlobalContext.ENDOFDAY
ISAFTER
▸ ISAFTER(date, dateToCompare): boolean
Returns true if the first date is after the second one
Parameters
| Name | Type |
|---|---|
date | DateLike |
dateToCompare | DateLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISAFTER
ISBEFORE
▸ ISBEFORE(date, dateToCompare): boolean
Returns true if the first date is before the second one
Parameters
| Name | Type |
|---|---|
date | DateLike |
dateToCompare | DateLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISBEFORE
ISFUTURE
▸ ISFUTURE(date): boolean
Returns true if the date is in the future
Parameters
| Name | Type |
|---|---|
date | DateLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISFUTURE
ISPAST
▸ ISPAST(date): boolean
Returns true if the date is in the past
Parameters
| Name | Type |
|---|---|
date | DateLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISPAST
MAXDATE
▸ MAXDATE(...values): Date
Returns the latest of the given dates.
Parameters
| Name | Type |
|---|---|
...values | (null | DateLike)[] |
Returns
Date
Inherited from
ExpressionGlobalContext.MAXDATE
MINDATE
▸ MINDATE(...values): Date
Returns the earliest of the given dates.
Parameters
| Name | Type |
|---|---|
...values | (null | DateLike)[] |
Returns
Date
Inherited from
ExpressionGlobalContext.MINDATE
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
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | Date
Inherited from
ExpressionGlobalContext.PARSEDATE
STARTOFDAY
▸ STARTOFDAY(date): null | Date
Returns the start of the day for a given date and time
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | Date
Inherited from
ExpressionGlobalContext.STARTOFDAY
TODAY
▸ TODAY(): Date
Returns the start of the current day
Returns
Date
Inherited from
ExpressionGlobalContext.TODAY
Logical Functions Methods
IF
▸ IF(logicalTest, valueIfTrue, valueIfFalse): any
Parameters
| Name | Type |
|---|---|
logicalTest | any |
valueIfTrue | any |
valueIfFalse | any |
Returns
any
Inherited from
ExpressionGlobalContext.IF
SWITCH
▸ SWITCH(valueToSwitch, valuesToMatchAndReturn, defaultValue?): any
Parameters
| Name | Type |
|---|---|
valueToSwitch | any |
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.
Parameters
| Name | Type |
|---|---|
number | null | NumberLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.ABS
CEILING
▸ CEILING(number): null | number
Rounds a number up to a whole number
Parameters
| Name | Type |
|---|---|
number | null | NumberLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.CEILING
FLOOR
▸ FLOOR(number): null | number
Rounds a number down to a whole number
Parameters
| Name | Type |
|---|---|
number | null | NumberLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.FLOOR
ISNUMERIC
▸ ISNUMERIC(number): boolean
Returns true if the value is a valid number
Parameters
| Name | Type |
|---|---|
number | any |
Returns
boolean
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
Parameters
| Name | Type |
|---|---|
number | null | NumberLike |
numberOfDigits? | number |
Returns
null | number
Inherited from
ExpressionGlobalContext.ROUND
Other Methods
DAY
▸ DAY(date): null | number
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.DAY
ISDATE
▸ ISDATE(value): boolean
Parameters
| Name | Type |
|---|---|
value | any |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISDATE
JOIN
▸ JOIN(seperator, ...values): boolean
Parameters
| Name | Type |
|---|---|
seperator | string |
...values | any[] |
Returns
boolean
Inherited from
ExpressionGlobalContext.JOIN
JULIANDAY
▸ JULIANDAY(date): null | number
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.JULIANDAY
MONTH
▸ MONTH(date): null | number
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.MONTH
YEAR
▸ YEAR(date): null | number
Parameters
| Name | Type |
|---|---|
date | null | DateLike |
Returns
null | number
Inherited from
ExpressionGlobalContext.YEAR
Text Functions Methods
FORMAT
▸ FORMAT(value, format): string
Parameters
| Name | Type |
|---|---|
value | string | number | Date |
format | string |
Returns
string
Inherited from
ExpressionGlobalContext.FORMAT
ISEMAIL
▸ ISEMAIL(value): boolean
Returns true is the value is a valid email address
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISEMAIL
ISEMPTY
▸ ISEMPTY(value): boolean
Returns true is the value is empty/blank
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISEMPTY
ISFALSE
▸ ISFALSE(value): boolean
Returns true is the value is false
Parameters
| Name | Type |
|---|---|
value | BooleanLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISFALSE
ISNEGATIVE
▸ ISNEGATIVE(value): boolean
Returns true is the value is less than 0
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISNEGATIVE
ISPOSITIVE
▸ ISPOSITIVE(value): boolean
Returns true is the value is greater than 0
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISPOSITIVE
ISTRUE
▸ ISTRUE(value): boolean
Returns true is the value is true
Parameters
| Name | Type |
|---|---|
value | BooleanLike |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISTRUE
ISZERO
▸ ISZERO(value): boolean
Returns true is the value is 0
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.ISZERO
LEFT
▸ LEFT(text, numberOfchars): string
Returns specified number of charachters the left hand side of a text string
Parameters
| Name | Type |
|---|---|
text | string |
numberOfchars | number |
Returns
string
Inherited from
ExpressionGlobalContext.LEFT
LEN
▸ LEN(text): number
Retruns the length of a text string
Parameters
| Name | Type |
|---|---|
text | string |
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
| Name | Type | Default value |
|---|---|---|
value | string | undefined |
like | string | undefined |
caseSensitive | boolean | false |
Returns
boolean
Inherited from
ExpressionGlobalContext.LIKE
LOWER
▸ LOWER(text): string
Parameters
| Name | Type |
|---|---|
text | string |
Returns
string
Inherited from
ExpressionGlobalContext.LOWER
MATCH
▸ MATCH(value, pattern): boolean
Parameters
| Name | Type |
|---|---|
value | string |
pattern | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.MATCH
MID
▸ MID(text, startFrom, numberOfchars): string
Parameters
| Name | Type |
|---|---|
text | string |
startFrom | number |
numberOfchars | number |
Returns
string
Inherited from
ExpressionGlobalContext.MID
NEWID
▸ NEWID(): string
Retruns a globally unique identifier
Returns
string
Inherited from
ExpressionGlobalContext.NEWID
NOTEMPTY
▸ NOTEMPTY(value): boolean
Returns true is the value is not empty/blank
Parameters
| Name | Type |
|---|---|
value | string |
Returns
boolean
Inherited from
ExpressionGlobalContext.NOTEMPTY
NUMBERVALUE
▸ NUMBERVALUE(text): null | number
Parameters
| Name | Type |
|---|---|
text | string |
Returns
null | number
Inherited from
ExpressionGlobalContext.NUMBERVALUE
PADEND
▸ PADEND(value, length, filler): string
Parameters
| Name | Type |
|---|---|
value | string |
length | number |
filler | string |
Returns
string
Inherited from
ExpressionGlobalContext.PADEND
PADSTART
▸ PADSTART(value, length, filler): string
Parameters
| Name | Type |
|---|---|
value | string |
length | number |
filler | string |
Returns
string
Inherited from
ExpressionGlobalContext.PADSTART
REPLACE
▸ REPLACE(text, start, length, newText): string
Parameters
| Name | Type |
|---|---|
text | string |
start | any |
length | any |
newText | any |
Returns
string
Inherited from
ExpressionGlobalContext.REPLACE
RIGHT
▸ RIGHT(text, numberOfchars): string
Retruns specified number of charachters the right hand side of a text string
Parameters
| Name | Type |
|---|---|
text | string |
numberOfchars | number |
Returns
string
Inherited from
ExpressionGlobalContext.RIGHT
SUBSTITUTE
▸ SUBSTITUTE(text, oldText, newText): string
Parameters
| Name | Type |
|---|---|
text | string |
oldText | string |
newText | string |
Returns
string
Inherited from
ExpressionGlobalContext.SUBSTITUTE
UPPER
▸ UPPER(text): string
Parameters
| Name | Type |
|---|---|
text | string |
Returns
string
Inherited from
ExpressionGlobalContext.UPPER