Below we provide a list of functions available in the expression language. Descriptions and examples are provided as applicable for each.
Synonyms: ConditionalAssignment | ConditionalReturn | ReturnIf | Select
Examples
ConditionalReturn("4 > 3", "Yes", "No") - returns Yes args[0] = boolean or string condition args[1] = return value if true args[2] = return value if false
Synonyms: Case | Map | MapValue | Switch
Examples
Case("test", {"test": 2, "other": 3}, 0) - returns 2 args[0] = key to map (can be of type number, string, or boolean) args[1] = obj (key-value pairs) args[2] = default value (returned if no keys match) Note: args[0] is compared to the keys of args[1] using the type of args[0] so that, for example, args[0] = 9.000000 compared to key "9" will resolve to true.
Synonyms: StringLength
Examples
StringLength("test") - returns 4 args[0] = string
Synonyms: StringRepeat
Examples
StringRepeat("AB", 2) - returns ABAB args[0] = string args[1] = integer
Synonyms: ToUpperCase
Examples
ToUpperCase("test") - returns TEST args[0] = string
Synonyms: ToLowerCase
Examples
ToLowerCase("TEST") - returns test args[0] = string
Synonyms: StringEquals
Examples
StringEquals("compareMe", "string1", "compareMe", ...) - returns true args[0] = string args[1] = check if equal to string args[2] = check if equal to string ... check all further arguments ... Returns true if args[0] matches any other args[n]
Synonyms: RegexMatch
Examples
RegexMatch("[0-9]+", "12345ABC", 0) - returns 12345 args[0] = regex args[1] = subject string args[2] = starting offset
Synonyms: RegexTest
Examples
RegexTest("[0-9]+", "12345ABC", 0) - returns true (because it maches) args[0] = regex args[1] = subject string args[2] = starting offset
Synonyms: RegexSearch
Examples
RegexSearch("[0-9]+", "ABC12345DEF", 0) - returns 3 (index of start of match) args[0] = regex args[1] = subject string args[2] = starting offset
Synonyms: RegexReplaceAll
Examples
RegexReplaceAll("[0-9]+", "ABC12345DEF", "999") - returns ABC999DEF (index of start of match) args[0] = regex args[1] = subject string args[2] = replace with
Synonyms: RegexReplaceAllWithBackReferences
Examples
RegexReplaceAllWithBackReferences("[0-9]+", "ABC12345DEF", "999") - returns ABC999DEF (index of start of match) args[0] = regex args[1] = subject string args[2] = replace with
Synonyms: Add | Sum
Examples
Add(1,2,3,4,5) - returns 15
Synonyms: Mult | Multiply | Prod | Product
Examples
Multiply(1,2,3,4,5) - returns 120
Synonyms: Rand
Examples
Rand(0,3) - returns a random number between 0 and 3 args[0] = lower limit (inclusive) args[1] = upper limit (exclusive)
Synonyms: Sub | Subtract
Examples
Subtract(5,3) - returns 2 args[0] = number to subtract from args[1] = number to subtract
Synonyms: Div | Divide
Examples
Divide(6,3) - returns 2 args[0] = number to divide args[1] = number to divide by
Synonyms: Mod | Modulo | Modulus | Rem | Remainder
Examples
Remainder(5,4) - returns 1 args[0] = number to divide args[1] = number to divide by
Synonyms: Quo | Quotient
Examples
Quotient(5,4) - returns 1 args[0] = number to divide args[1] = number to divide by
Synonyms: Pow | Power | PowerOfX
Examples
Power(2,3) - returns 8 args[0] = number to raise to a power args[1] = power to raise by
Synonyms: ScaleByPowerOf2 | ScaleByPowerOfTwo | TimesPowerOf2 | TimesPowerOfTwo
Examples
TimesPowerOfTwo(6,3) - returns 48 (6 * 2^3) args[0] = number to multiply by args[1] = power of two
Synonyms: IntegerInRange | IntInRange
Examples
IntegerInRange(0, 2, 3, false, false) - returns true args[0] = min args[1] = compare value args[2] = max args[3] = exclude lower limit (defaults to false) args[4] = exclude upper limit (defaults to false)
Synonyms: DBLInRange | DoubleInRange | InRange
Examples
IntegerInRange(0, 2, 2.5, false, false) - returns true args[0] = min args[1] = compare value args[2] = max args[3] = exclude lower limit (defaults to false) args[4] = exclude upper limit (defaults to false)
Synonyms: IntegerCoerceIntoRange
Examples
IntegerInRange(0, 3, 2, false, false) - returns 2 args[0] = min args[1] = compare value args[2] = max args[3] = exclude lower limit (defaults to false) args[4] = exclude upper limit (defaults to false)
Synonyms: DoubleCoerceIntoRange
Examples
DoubleInRange(0, 3, 2.5, false, false) - returns 2.5 args[0] = min args[1] = compare value args[2] = max args[3] = exclude lower limit (defaults to false) args[4] = exclude upper limit (defaults to false)
Synonyms: Pow10 | Power10 | PowerOf10
Examples
PowerOf10(3) - returns 1000 args[0] = power of ten to compute
Synonyms: Inc | Increment | Plus1 | PlusOne
Examples
Increment(3) - returns 4 args[0] = number to increment
Synonyms: Dec | Decrement | Minus1 | MinusOne
Examples
Decrement(3) - returns 2 args[0] = number to decrement
Synonyms: Sin | Sine
Examples
Sin(pi()) - returns 0 args[0] = number to compute sine of
Synonyms: Cos | Cosine
Examples
Cos(pi()) - returns 0 args[0] = number to compute cosine of
Synonyms: Tan | Tangent
Examples
Tan( (pi()/2) ) - returns 1 args[0] = number to compute tangent of
Synonyms: Sec | Secant
Examples
Sec(1) - returns 1.85081571768 args[0] = number to compute secant of
Synonyms: Cosecant | Csc
Examples
Csc(1) - returns 1.18839510578 args[0] = number to compute cosecant of
Synonyms: Cot | Cotangent
Examples
Cot(1) - returns 1.18839510578 args[0] = number to compute cotangent of
Synonyms: Abs | Absolute | AbsoluteValue
Examples
Abs(-2) - returns 2 args[0] = number to compute cotangent of
Synonyms: Rnd | Round
Examples
Round(1.2) - returns 1 args[0] = number to round to nearest integer Note: if the value is midway between two integers, returns the nearest even integer
Synonyms: Floor | RoundDown
Examples
Floor(1.2) - returns 1 args[0] = rounds down to the next lowest integer
Synonyms: RoundToDecimalPlace
Examples
RoundToDecimalPlace(1.6666, 3) - returns 1.667 args[0] = number to round to specified decimal place args[1] = decimal place to round to
Synonyms: TruncateAtDecimalPlace
Examples
RoundToDecimalPlace(1.6666, 3) - returns 1.666 args[0] = number to truncate at specified decimal place args[1] = decimal place to truncate at
Synonyms: Ceil | Ceiling | RoundUp
Examples
Ceil(1.2) - returns 2 args[0] = rounds up to the next highest integer
Synonyms: Sqrt | SquareRoot
Examples
Sqrt(4) - returns 2 args[0] = number to take square root of
Synonyms: Square
Examples
Square(4) - returns 16 args[0] = number to square
Synonyms: Reciprocal | Reciprocate
Examples
Reciprocal(4) - returns 0.25 args[0] = number to reciprocate
Synonyms: Log | Log10
Examples
Log(1) - returns 0 args[0] = number to compute log of (base 10)
Synonyms: Ln | Log2
Examples
ln(1) - returns 0 args[0] = number to compute natural log of (base e)
Synonyms: GenerateArray
Examples
GenerateArray(0, 0.1, 5) - returns [0, 0.1, 0.2, 0.3, 0.4] args[0] = Initial Value args[1] = Increment args[2] = Size
Synonyms: InArray
Examples
InArray(0, [0,1,2]) - returns true args[0] = search for element args[1] = search in array
Synonyms: ArraysIntersect
Examples
ArraysIntersect([1,2,3], [0,1,2]) - returns true args[0] = array 1 args[1] = array 2
Synonyms: ArraySize
Examples
ArraySize([1,2,3]) - returns 3 args[0] = array
Synonyms: ArrayAND
Examples
ArrayAND([true, false, true]) - returns false args[0] = array
Synonyms: ArrayOR
Examples
ArrayOR([true, false, true]) - returns true args[0] = array
Synonyms: ArrayIndex
Examples
ArrayIndex([1,2,3], 1) - returns 2 args[0] = array args[1] = index of desired value
Synonyms: ArrayAppend
Examples
ArrayAppend([1,2,3], 4) - returns [1,2,3,4] args[0] = array args[1] = value to append
Synonyms: ArrayDeleteElement
Examples
ArrayDeleteElement([1,2,3], 1) - returns [1,3] args[0] = array args[1] = index of value to delete
Synonyms: ArrayReplaceElement
Examples
ArrayAppend([1,2,3], 0, 4) - returns [4,2,3] args[0] = array args[1] = value to append
Synonyms: ArrayInsertElement
Examples
ArrayInsertElement([1,2,3], 0, 4) - returns [4,1,2,3] args[0] = array args[1] = index to insert at args[2] = value to insert
Synonyms: ArrayEqual
Examples
ArrayEqual([1,2,3],[1,2,3], false) - returns true args[0] = array 1 args[1] = array 2 args[2] = whether to ignore order (defaults to false)
Synonyms: JSONJoin | JSONMerge | ObjectJoin | ObjectMerge
Examples
ObjectJoin("Upsert", {"test": 1}, {"other": 2}) - returns {"test": 1, "other": 2} args[0] = json obj args[1] = json obj args[2] = merge mode
Synonyms: JSONEqual | ObjectEqual
Examples
JSONEqual({"test": 1}, {"test": 1}, "", "") - returns true args[0] = json obj 1 args[1] = json obj 2 args[2] = path in json obj 1 (optional) args[3] = path in json obj 2 (optional)
Synonyms: GetDateTime
Examples
GetDateTime(yyyy) - returns 2018 args[0] = format (string) args[1] = UTC format? (boolean if args[0] is a format) OR precision (double if args[0] is SecondsSinceEpoch) Note that 'epoch time' here refers to the number of seconds elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00]
Synonyms: Wait
Examples
Wait(2000) - returns value of the millisecond timer args[0] = number to milliseconds to wait
Synonyms: GetTickCount
Examples
GetTickCount(2000) - returns value of the millisecond timer args[0] = unit of time to return (Milliseconds | Seconds | Minutes | Hours | Days; defaults to Milliseconds)
Synonyms: isNull
Examples
isNull(null) - returns true args[0] = value to test if null
Synonyms: isBoolean
Examples
isBoolean(true) - returns true args[0] = value to test if boolean
Synonyms: isNumber
Examples
isNumber(10.7) - returns true args[0] = value to test if number
Synonyms: isArray
Examples
isNumber([1,2,3]) - returns true args[0] = value to test if array
Synonyms: isObject
Examples
isNumber({"a": 1}) - returns true args[0] = value to test if object
Synonyms: ZeroPad
Examples
ZeroPad(1.23, 5, "Right") - returns 1.230 args[0] = value args[1] = total width args[2] = left or right (defaults to padding on the left)
Synonyms: EvaluateStringToBoolean
Examples
EvaluateStringToBoolean("some wild thing") - returns false args[0] = "any string" Note: 0. quotes are optional (though to be a function, what's passed in must be a json type, so string wrapping with quotes will treat the general case) 1. true, !0, !F, !false, and !null will evaluate to true 2. everything else evaluates to false
Synonyms: ToDBL | ToDouble
Examples
ToDBL("2.3") - returns 2.30000000000000000 args[0] = value
Synonyms: ToI64
Examples
ToI64("2.3") - returns 2 args[0] = value
Synonyms: ToU64
Examples
ToU64("2.3") - returns 2 args[0] = value
Synonyms: ToI32 | ToInt
Examples
ToI32("2.3") - returns 2 args[0] = value
Synonyms: ToU32 | ToUInt
Examples
ToU32("2.3") - returns 2 args[0] = value
Synonyms: ToI16
Examples
ToI16("2.3") - returns 2 args[0] = value
Synonyms: ToU16
Examples
ToU16("2.3") - returns 2 args[0] = value
Synonyms: ToI8
Examples
ToI8("2.3") - returns 2 args[0] = value
Synonyms: ToU8
Examples
ToU8("2.3") - returns 2 args[0] = value
Synonyms: TCVoltageToCelcius | ThermocoupleVoltageToCelcius
Examples
ThermocoupleVoltageToCelcius(2.3, "B") - returns 42.5683 args[0] = value
Synonyms: CelciusToKelvin
Examples
CelciusToKelvin(10) - returns 283.15 args[0] = value
Synonyms: KelvinToCelcius
Examples
KelvinToCelcius(10) - returns -263.15 args[0] = value
Synonyms: KelvinToFarenheit
Examples
KelvinToFarenheit(10) - returns -441.67 args[0] = value
Synonyms: CelciusToFarenheit
Examples
CelciusToFarenheit(-40) - returns -40 args[0] = value
Synonyms: FarenheitToCelcius
Examples
FarenheitToCelcius(-40) - returns -40 args[0] = value
Synonyms: FarenheitToKelvin
Examples
FarenheitToKelvin(-40) - returns 233.15 args[0] = value
Synonyms: U64UpperBytesAsU32
Examples
U64UpperBytesAsU32(10000000000) - returns 2 args[0] = value
Synonyms: U64LowerBytesAsU32
Examples
U64LowerBytesAsU32(10000000000) - returns 1410065408 args[0] = value
Synonyms: I64UpperBytesAsU32
Examples
I64UpperBytesAsU32(10000000000) - returns 4294967293 args[0] = value
Synonyms: I64LowerBytesAsU32
Examples
I64LowerBytesAsU32(10000000000) - returns 2884901888 args[0] = value
Synonyms: U32UpperBytesAsU16
Examples
U32UpperBytesAsU16(100000) - returns 1 args[0] = value
Synonyms: U32LowerBytesAsU16
Examples
U32LowerBytesAsU16(100000) - returns 34464 args[0] = value
Synonyms: I32UpperBytesAsU16
Examples
I32UpperBytesAsU16(-100000) - returns 65534 args[0] = value
Synonyms: I32LowerBytesAsU16
Examples
U32LowerBytesAsU16(-100000) - returns 31072 args[0] = value
Synonyms: U16UpperByteAsU8
Examples
U16UpperBytesAsU8(300) - returns 1 args[0] = value
Synonyms: U16LowerByteAsU8
Examples
U16LowerBytesAsU8(300) - returns 44 args[0] = value
Synonyms: I16UpperByteAsU8
Examples
I16UpperBytesAsU8(-300) - returns 254 args[0] = value
Synonyms: I16LowerByteAsU8
Examples
I16LowerBytesAsU8(-300) - returns 212 args[0] = value
Synonyms: CharToByte | CharToU8
Examples
CharToByte(string, index) CharToByte("AB", 0) - returns 65 (since A has underlying byte value 65) CharToByte("AB", 1) - returns 66 (since B has underlying byte value 66) returns the value of the byte corresponding to the character (specified by index) in the supplied string
Synonyms: BytesToString
Examples
BytesToString([byte, byte]) - returns the string corresponding to the byte array BytesToString([65,66]) - returns the string "AB" (without quotes)
Synonyms: HexEncodeString
Examples
HexEncodeString("A") - returns the string "41" HexEncodeString("AB") - returns the string "4142"
Synonyms: HexEncodedCharToByte | HexEncodedCharToU8
Examples
HexEncodedCharToByte("41") - returns 65 (i.e. the base 10 value of 0x41)
Synonyms: GetByteAtPosition
Examples
GetByteAtPosition(5, 0) - returns 5 (00000000 00000101) GetByteAtPosition(5, 1) - returns 0 (00000000 00000101) GetByteAtPosition(256, 0) - returns 0 (00000001 00000000) GetByteAtPosition(256, 1) - returns 1 (00000001 00000000)
Synonyms: StringToBytewiseXORHexString
Examples
StringToBytewiseXORHexString("CSTLT,+0996.83,+0001.94,-0057.47,+093.300,+000.112,+028.0") - returns 5B
Synonyms: Pi
Examples
Pi() - returns the value of pi (3.1415....)
Synonyms: e
Examples
e() - returns the value of pi (2.71828....)
Synonyms: SpeedOfLight
Examples
SpeedOfLight() - returns the value of the speed of light in meters per second (299792458 m/s)
Synonyms: G | GravitationalConstant
Examples
GravitationalConstant() or G() - returns the value of the gravitational constant (6.6742E-11)
Synonyms: Avogadro | AvogadrosNumber
Examples
AvogadrosNumber() or Avogadro() - returns Avogadros Number (6.0221415E+23)
Synonyms: p | Planck
Examples
p() or Planck() - returns Planck's constant (6.6260693E-34)
Synonyms: ElectronCharge
Examples
ElectronCharge() - returns the charge of an electron (1.60217653E-19)
Synonyms: Rydberg
Examples
Rydberg() - returns Rydberg's constant (10973731.56853)
Synonyms: MolarGasConstant
Examples
MolarGasConstant() - returns the Molar Gas constant (8.314472)