Expression Language reference
An expression comprises two main elements, functions and operators. These are then structured around brackets to create a custom formula:
- Functions - The part of the data that is to be operated on including Profile Attributes and Constants. These are then processed using functions
- Operators - determine the action to be performed and can be Arithmetic, Logical or a Comparison
- Brackets - these determine the order of operations and allow for the grouping of functions and operators to build complex, custom formulas.
As an example, you could use a formula to calculate the conversion rate of an email campaign if you are capturing emails sent and emails clicked data. The custom formula would look something like this:
round(100\*(email_link_clicks/emails_sent),0)
Functions
A function is a pre-defined process that is run against constants and profile attributes to perform a complex task such as:
- Rounding or comparing numbers
- Formatting text or timestamps
- Date manipulation
You use functions whenever you are building your formula in the web interface.
You can use the following functions:
String functions
Len
Returns the length of a string or profile attribute.
This may be useful if you would like to evaluate if a string or profile attribute has an appropriate length.
Availability | Available in Moments and People. |
---|---|
Format | len(stringValue) |
Input datatype | String |
Output datatype | Integer |
Example | len("infobip.com") Output: 11 |
Find
Returns the position of a substring inside a string as a whole number.
This is useful if you are looking to find a subset of data inside a string or profile attribute. This function is case sensitive.
find() is zero-based (offset) meaning that it is indexed from 0. If the find() function matches the entry at the beginning of a string then the output will be 0.
Availability | Available in Moments and People. |
---|---|
Format | find(stringValue, search) |
Input datatype | String, String |
Output datatype | Integer |
Example | To use a simple example using a firstName attribute of a profile for a user called Andrea:find(First Name, "a") will output the number 5 for Andreafind(First Name, "A") will output 0 for AndreaIf no substring is matched using the find() function then the output will be -1find(First Name, "b") will output -1 for Andrea |
Replace
Replace a part of a string that contains an old value with a new value.
As a simple example, replace( "Good morning", "morning", "afternoon") would output Good afternoon
Availability | Moments Only |
---|---|
Format | replace(stringValue, oldValue, newValue) |
Input datatype | String, String, String |
Output datatype | String |
Example | replace( "I love cats", "cats", "dogs")Output: I love dogs |
Trim
Trims spaces, newlines and tabs from both ends of a string.
Availability | Moments Only |
---|---|
Format | trim(stringValue) |
Input datatype | String |
Output datatype | String |
Example | trim(" abc ")Output: abc |
Left
Returns a count of the first characters from a string or profile attribute.
This is useful if you want to return the first characters from a profile attribute or string of text.
To use a simple example, left(city ,4)
If the city attribute is London then the output would return the first 4 characters of London: Lond.
Availability | Available in Moments and People. |
---|---|
Format | left(stringValue, count) |
Input datatype | String, Integer |
Output datatype | String |
Example | left("I love cats",5)Output: I lov |
Right
Returns a count of the last characters from a string or profile attribute.
This is useful if you want to return the last characters from a profile attribute or string of text.
To use a simple example, right(city ,4)
If the city attribute is London then the output would return the last 4 characters of London: ndon.
Availability | Available in Moments and People. |
---|---|
Format | right(stringValue, count) |
Input datatype | String, Integer |
Output datatype | String |
Example | right("I love cats",4)Output: cats |
Mid
Returns a count of characters from a string or profile attribute starting from a chosen offset value.
This is useful if you want to return an exact number of characters from the middle of a string or profile attribute.
This function is zero-based (offset) meaning that it is indexed from 0. Be sure to take this into account when you are defining the offset parameters to define where the count should start.
To use a simple example, mid(city,2,3)
If the city attribute is London then the output will be ndo because offset is 2 and character count is 3.
Availability | Available in Moments and People. |
---|---|
Format | mid(stringValue, offsetValue, countValue) |
Input datatype | String, Integer, Integer |
Output datatype | String |
Example | mid("I love cats",2,4)Output: love |
Concatenate
Returns the concatenated string.
This is useful if you would like to combine multiple strings or profile attributes into a single output.
A simple example would be to combine a persons first name (firstName attribute) and last name (lastName attribute) into a single result if you ever need to capture their full name for marketing purposes.
Use concat(First Name, " ", Last Name) for this example.
If First Name attribute is Edward and Last Name attribute is Jones. Then the output would be Edward Jones.
Availability | Available in Moments and People. |
---|---|
Format | concat(stringValue 1, stringValue 2, stringValue n ...) |
Input datatype | String, String, String, ... n |
Output datatype | String |
Example | concat("I", " Love ", "Cats")Output: I Love Cats |
Contains
Text search within a string (appears somewhere inside the string).
Use contains() to identify case sensitive text from within a larger body of text.
Availability | Moments only |
---|---|
Format | contains(stringValue, search) |
Input datatype | String, String |
Output datatype | Boolean |
Example | contains("CAT,dad,Frog,doggybag,hotdog","dog")Output: Truecontains("CAT,Frog,doggybag,hotdog","bird")Output: False |
Starts with
Use startsWith() to determine whether a string starts with the characters of a particular string.
Availability | Moments only |
---|---|
Format | startsWith(stringValue, search) |
Input datatype | String, String |
Output datatype | Boolean |
Example | startsWith("Josephine","Jo")Output: True |
Ends with
Use endsWith() to determine whether a string ends with the characters of a particular string.
Availability | Moments only |
---|---|
Format | endsWith(stringValue, search) |
Input datatype | String, String |
Output datatype | Boolean |
Example | endsWith("Josephine","Jo")Output : False |
leftPad
Use leftPad to pad to the left of the original string with a padding string. The size integer specifies how many characters the new value should be, including the original-string.
Availability | Moments only |
---|---|
Format | leftPad(original string, size integer, padding string) |
Input datatype | String, Integer, String |
Output datatype | String |
Example | leftPad("15", 6, "0")Output : 000015leftPad("15", 7, "02")Output: 0202015 |
Date / Time functions
Now
Use now() to return the current time (local) in DateTime format.
Availability | Moments only |
---|---|
Format | now() |
Input datatype | - |
Output datatype | DateTime |
Example | now()Output: YYYY-MM-DD THH:mm:ssZi.e. 2009-09-24T11:34:56Z |
Today
Use today() to return todays date (without time) in Date format by default
You can include the optional timezone parameter by adding following format to your expression:
+h
+hh
+hh:mm
-hh:mm
+hhmm
-hhmm
+hh:mm:ss
-hh:mm:ss
+hhmmss
-hhmmss
For example, today("-0600") would set the timezone to -6 hours
Availability | Moments only |
---|---|
Format | today() |
Input datatype | - / String |
Output datatype | Date |
Example | today() |
Date add
Use addDays/addMonths etc. to add an integer amount to a date or time.
addHours, addMinutes and addSeconds operators outputs in Date Time. Other addDate operators output Date Time/Date.
Subtract time by applying a minus integer in your expression.
For example, adddays(todatetime("2009-09-24","yyyy-MM-dd"), -4) would output: 2009-09-20 00:00:00
Availability | Moments only |
---|---|
Format | addDays(dateTimeValue, amount)addHours(dateTimeValue, amount)addMinutes(dateTimeValue, amount)addSeconds(dateTimeValue, amount)addWeeks(dateTimeValue, amount)addMonths(dateTimeValue, amount)addQuarters(dateTimeValue, amount)addYears(dateTimeValue, amount) |
Input datatype | DateTime or Date, Integer |
Output datatype | DateTime or Date |
Example | addDays(toDate("2009-09-24", "yyyy-MM-dd"), 4)Output: 2009-09-28addDays(toDate("2009-09-24", "yyyy-MM-dd"), -4)Output: 2009-09-20 |
Date diff
Returns the difference between dt1 and dt2 date/datetime profile attributes as a decimal.
The output result is in days by default.
You can set optional parameter modes to change the output to years, months, days, hours or seconds by including a string input.
This function is extremely powerful for calculating date differences relating to different events. For example, perhaps you would like to see the date difference between a user making a first order and when they completed last order or the date difference between purchase date and delivery date.
This can be done using the dateDiff() function.
For example, dateDiff(firstOrderDate, lastOrderDate) would return the uptput the difference in days.
dateDiff(firstOrderDate, lastOrderDate, "hours") would return the result in hours and dateDiff(firstOrderDate, lastOrderDate, "minutes") would return the result in minutes.
If you need the output to be a whole number, use round() function to round the decimal number.
Availability | Available in Moments and People |
---|---|
Format | dateDiff(dateValue 1, dateValue 2, [string]) |
Input datatype | DateTime or Date, DateTime or Date, String |
Output datatype | Decimal |
Example | dateDiff(toDateTime("2016-01-12 01:08:12", "yyyy-M-d HH:mm:ss"), toDateTime("2017-01-12 01:08:12", "yyyy-M-d HH:mm:ss"), "years")Output: 1dateDiff(toDate("2016-01-12", "yyyy-M-d"), toDate("2016-01-11", "yyyy-M-d"), "hours")Output: 24dateDiff(toDate("2016-01-12", "yyyy-M-d"), toDateTime("2016-01-12 00:10:00", "yyyy-M-d HH:mm:ss"), "minutes")Output: 10The toDate or toDateTime functions are not currently available for use in People.Use dateDiff with attributes like dateDiff(Purchase Date, Delivery Date). |
Year
Returns the year for a dt date/datetime profile attribute
This is useful if you would like to return only the year of a date/datetime profile attribute and then use it to create milestone marketing events around the year of birth.
As a simple example if the Birth Date attribute is 04/12/1974
year(Birth Date) expression would output 1974
Availability | Available in Moments and People |
---|---|
Format | year(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | year(toDate("1981-07-12", "yyyy-MM-dd"))Output: 1981The toDate or to DateTime functions are not currently available for use in People.Use year with profile attributes like year(Birth Date) to show the year of birth |
Quarter
Returns the calendar quarter (1-4) for a dt date/datetime profile attribute
This is useful if you would like to filter profile attributes by the calendar quarter (i.e. Q1 to Q4) and then target those profiles with particular marketing communications.
As a simple example, if the purchaseDate attribute is 04/12/2020 then the output of quarter(purchaseDate) would be 4
Availability | Available in Moments and People |
---|---|
Format | quarter(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | quarter(toDate("1981-07-12", "yyyy-MM-dd"))Output: 3The toDate or toDateTime functions are not currently available for use in People.Use quarter with profile attributes like quarter(Birth Date) to show which quarter the birthday falls on. |
Month
Returns the month as a whole number (1-12) for a dt date/datetime profile attribute.
For example, if a user Birth Date attribute is 04/12/1974 then the expression month(Birth Date) would output 12
Availability | Available in Moments and People |
---|---|
Format | month(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | month(toDate("1981-07-12", "yyyy-MM-dd"))Output: 7The toDate or toDateTime functions are not currently available for use in People.Use month with profile attributes like month(Birth Date) to show which month the birthday falls on. |
Day
Returns the day (1-31) for a dt date/datetime profile attribute
For example, if a user Birth Date attribute is 04/12/1974 then the expression day(Birth Date) would output 4
Availability | Available in Moments and People |
---|---|
Format | day(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | day(toDate("1981-07-12", "yyyy-MM-dd"))Output: 12The toDate or toDateTime functions are not currently available for use in People.Use day with profile attributes like day(Birth Date) to show which day the birthday falls on. |
Hour
Returns the hour part of a dt datetime profile attribute.
This is useful for delivery or purchase related profile attributes.
For example if you have a profile attribute called deliveryDate you could run the expression hour(deliveryDate) to output the hour of delivery for a product or item.
So if deliveryDate is 2020-07-12 11:22:56 then the output would be 11
Availability | Available in Moments and People | |
---|---|---|
Format | hour(dateTimeValue) | |
Input datatype | DateTime | |
Output datatype | Integer | |
Example |
|
Minute
Returns the minute of a given (date)time (or profile attribute)
Availability | Moments only |
---|---|
Format | minute(dateTimeValue) |
Input datatype | DateTime |
Output datatype | Integer |
Example | minute(toDateTime("1981-07-12 12:34:56", "yyyy-M-d HH:mm:ss"))Output: 34 |
Second
Returns the second of a given (date)time (or profile attribute)
Availability | Moments only |
---|---|
Format | second(dateTimeValue) |
Input datatype | DateTime |
Output datatype | Integer |
Example | second(toDateTime("1981-07-12 12:34:56", "yyyy-M-d HH:mm:ss"))Output: 56 |
Day of year
Returns the day of the year for a dt date/datetime profile attribute. Where the count starts on January 1st and ends on the date set.
This is useful for purchases or delivery related profile attributes and building campaigns around a particular day of the year i.e. New Year's Day or Black Friday.
For example, if purchaseDate attribute is 2020-07-12 11:22:56 then the dayOfYear(purchaseDate) output would be 193
Availability | Available in Moments and People |
---|---|
Format | dayOfYear(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | dayOfYear(toDate("2021-10-12", "yyyy-M-d"))Output: 193The toDate or toDateTime functions are not currently available for use in People.Use dayOfYear with date time attributes like dayOfYear(Last Purchase Date) to show which day of the year the last purchase was made. |
Day of week
Returns the day of the week (1-7) for the dt date/datetime profile attribute. Where Monday is 1 and Sunday is 7.
For example, if the deliveryDate attribute is 2020-07-12 11:22:56 then the expression dayOfWeek(deliveryDate) will be 3.
Availability | Available in Moments and People |
---|---|
Format | dayOfWeek(dateTimeValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | dayOfWeek(toDate("2021-10-12", "yyyy-M-d"))Output: 3The toDate or toDateTime functions are not currently available for use in People.Use dayOfWeek with date time attributes like dayOfWeek(Last Purchase Date) to show which day of the week the last purchase was made. |
Format date time
Takes Date Time as input and returns string with formatted Date Time
User setup needs format as a second attribute. unix format is supported.
Other types of format can be defined by user according to mask and components.
d: The day of the month, from 1 through 31.
dd: The day of the month, from 01 through 31.
eee: Day of the week abbreviated
eeee: The full name of the day of the week.
h: The hour, 12-hour clock from 1 to 12.
hh: The hour,12-hour clock from 01 to 12.
H: The hour, 24-hour clock from 0 to 23.
HH: The hour, 24-hour clock from 00 to 23.
m: The minute, from 0 through 59.
mm: The minute, from 00 through 59.
M: The month, from 1 through 12.
MM: The month, from 01 through 12.
MMM: Name of the month abbreviated
MMMM: The full name of the month.
s: The second, from 0 through 59.
ss: The second, from 00 through 59.
a: AM/PM designator.
y: The year as a four-digit number.
yy: The year, from 00 to 99.
yyyy: The year as a four-digit number.
Availability | Moments only |
---|---|
Format | formatDateTime(dateTimeValue, formatValue) |
Input datatype | DateTime or Date |
Output datatype | Integer |
Example | formatDateTime(toDateTime("2021-08-03 14:05:13", "yyyy-M-d HH:mm:ss"), "unix")Output: 1627988713formatDateTime(toDateTime("2021-08-03 14:05:13", "yyyy-M-d HH:mm:ss"), "dd-MM-yy h:mm a eee")Output: 03-08-21 2:05 PM TueThe toDate or toDateTime functions are not currently available for use in People. |
Format date
Takes Date as an input and returns a string with Date formatted according to the user's needs.
The desired format needs to be added as a second attribute.
The user can define other formats according to mask and components.
d: The day of the month, from 1 through 31.
dd: The day of the month, from 01 through 31.
eee: The abbreviated name of the day of the week.
eeee: The full name of the day of the week.
M: The month, from 1 through 12.
MM: The month, from 01 through 12.
MMM: The abbreviated name of the month.
MMMM: The full name of the month.
y: The year as a four-digit number.
yy: The year, from 00 to 99.
yyyy: The year as a four-digit number.
Availability | Moments only |
---|---|
Format | formatDate(date, formatValue) |
Input datatype | Date, String |
Output datatype | String |
Example | formatDate(toDate("2007-04-05", "yyyy-MM-dd"), "dd.MM.yyyy")Output: 05.04.2007formatDate(toDate("05/04/2007", "dd/MM/yyyy"), "yyyy-MM-dd")Output: 2007-04-05The formatDate function is not currently available for use in People. |
Operators
You can use operators to perform calculations and comparisons within custom formulas. This is very useful in scenarios if you would like to run calculations against values i.e. adding up scores or counting the number of times a user has interacted with your service.
You can use the following operators:
- Arithmetic: Abs, +, -, /, *, Modulo %, Round, Floor
- Logical: AND, OR, NOT, >, <, >=, ==, !=
- Conversion: toInt, toDecimal, toDate, toTime, toDateTime, toString, toBool
- Other: generatePin
Arithmetic operators
Abs
Returns the absolute value of a given number or profile attribute
For example, both abs(5) and abs(-5) functions would output 5
Availability | Available in Moments and People |
---|---|
Format | abs(decimalValue) |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | abs(5) Output: 5 |
Add
Add values together using +
For example, the expression 1 + 2 + 3 would output 6
Availability | Available in Moments and People |
---|---|
Format | + |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | 1 + 2 + 3Output: 6 |
Subtract
Subtract values from another value using -
For example, the expression 5 - 3 would output 2
Availability | Available in Moments and People |
---|---|
Format | - |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | 5 - 3Output: 2 |
Divide
Divide values using /
For example, the expression 4 / 2 would output 2
Availability | Available in Moments and People |
---|---|
Format | / |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | 4 / 2Output: 2 |
Multiply
Multiply values using *
For example, the expression 2 * 2 would output 4
Availability | Available in Moments and People |
---|---|
Format | x |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | 2 * 2Output: 4 |
Modulo
Return the modulo (remainder) of a divided value
For example, the expression 12 % 8 would output 4
Availability | Available in Moments and People |
---|---|
Format | % |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | 12 % 8Output: 4 |
Round
Returns the value of num rounded to the nearest value with digits after the decimal point. Scale the number of decimal points within the expression.
Round to the nearest whole number
For example, the expression round(1.23456, 3) would round up to 3 decimal places. So the result is 1.235
Availability | Available in Moments and People |
---|---|
Format | round(decimalValue, scale) |
Input datatype | Decimal or Integer, Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | round(1.23456,3)Output: 1.235 |
Floor
Returns the value of num rounded down to the nearest integer value.
So the expression floor(1.2345) would output 1
Availability | Available in Moments and People |
---|---|
Format | floor(decimalValue) |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | floor(1.2345)Output: 1 |
Ceil
Returns the value of num rounded up to the nearest integer value.
So the expression ceil(1.7) would output 2
Availability | Available in Moments and People |
---|---|
Format | ceil(decimalValue) |
Input datatype | Decimal or Integer |
Output datatype | Decimal or Integer (dependent on input datatype) |
Example | ceil(1.7)Output: 2 |
Logical operators
Equal
The == operator is used to evaluate if two values are equal and output True or False depending on the result.
As a simple example, 5 == 5 would output to True and First Name == Last Name would output to False.
Availability | Available in Moments and People |
---|---|
Format | == |
Input datatype | Any input dataype |
Output datatype | Boolean |
Example | "A" == "A"Output: True |
Not equal
The != operator is used to evaluate if two values are not equal and output True or False depending on the result.
As a simple example, 5 != 5 would output to False and First Name != Last Name would output to True.
Availability | Available in Moments and People |
---|---|
Format | != |
Input datatype | Any input type |
Output datatype | Boolean |
Example | "A" != "A"Output: False |
Greater than
The > operator is used to evaluate if a value is more than a different value and output True or False depending on the result.
As an example, 1 > 5 would output False.
Availability | Available in Moments and People |
---|---|
Format | > |
Input datatype | Decimal or Integer |
Output datatype | Boolean |
Example | 1 > 5Output: False |
Greater than or equal
The >= operator is used to evaluate if a value is more than or equal to another value and output True or False depending on the result.
As an example, 1 >= 5 would output False.
Availability | Available in Moments and People |
---|---|
Format | >= |
Input datatype | Decimal or Integer |
Output datatype | Boolean |
Example | 1 >= 5Output: False |
Less than
The < operator is used to evaluate if a value is less than a different value and output True or False depending on the result.
As an example, 1 < 5 would output True.
Availability | Available in Moments and People |
---|---|
Format | < |
Input datatype | Decimal or Integer |
Output datatype | Boolean |
Example | 1 < 5Output: True |
Less than or equal
The <= operator is used to evaluate if a value is less than or equal to another value and output True or False depending on the result.
As an example, 1 <= 5 would output True.
Availability | Available in Moments and People |
---|---|
Format | <= |
Input datatype | Decimal or Integer |
Output datatype | Boolean (True / False) |
Example | 1 <= 5Output: True |
And
The and operator returns True if both operands are True and returns False otherwise.
This is a very effective way of creating complex custom formulas when used with brackets to order precedence.
As a simple example, the expression (1==5) and (Gender=='m') would output False.
Availability | Available in Moments and People |
---|---|
Format | and |
Input datatype | Boolean |
Output datatype | Boolean |
Example | (1==5) and (3==4) Output: False |
Or
The or operator returns False if both operands are False and returns True otherwise.
An examples expression could be (5 ==5) or (Gender == "m") which would output True.
Availability | Available in Moments and People |
---|---|
Format | or |
Input datatype | Boolean |
Output datatype | Boolean |
Example | (5 ==5) or (3==4)Output: True |
Not
The not operator is a Boolean operator that returns True when the operand is False, and returns False when the operand is True.
A simple example is not(5==5) which would output False.
Availability | Available in Moments and People |
---|---|
Format | not |
Input datatype | Boolean |
Output datatype | Boolean |
Example | not(5==5)Output: False |
If
The if function evaluates the boolean expression passed as its first parameter and depending on the result returns option1 if true, or option2 if false.
Availability | Moments only |
---|---|
Format | if(predicate, option1, option2) |
Input datatype | Boolean, option1 (datatypes: True/False/Date Time/Date/Decimal Number/Whole Number/Text), option2 (datatypes: True/False/Date Time/Date/Decimal Number/Whole Number/Text) |
Output datatype | Output datatype will be the same as the datatype chosen at Input. |
Example | if(Gender == "M", "Mr", (if(MaritalState== "Married", "Mrs", "Ms"))Output: Value is 'Mr' if gender is M.Value is 'Mrs' if gender is not M, and MaritalState is married.Value is 'Ms' if gender is not M, and MaritalState is not marrried. |
isEmpty
The isEmpty operator is a Boolean operator that returns true if an attribute/variable has no value, and returns false if an attribute/variable has a value.
Availability | Moments only |
---|---|
Format | isEmpty(any) |
Input datatype | Any input datatype |
Output datatype | Boolean |
Example | isEmpty(BirthDate)Output: True if no value exists for the attribute/variable |
Conversion operators
toInt
Convert a decimal, integer or string to integer.
Availability | Moments only |
---|---|
Format | toInt(decimalValue) |
Input datatype | Decimal or Integer or String |
Output datatype | Integer |
Example | toInt("123.345")Output: 123toInt(NULL)Output: 0 |
toDecimal
Convert a decimal, integer or string to decimal.
Availability | Moments only |
---|---|
Format | toDecimal( string text) |
Input datatype | Decimal or Integer or String |
Output datatype | Decimal |
Example | toDecimal("123.345")Output: 123.345toDecimal(NULL)Output: 0 |
toDate
Convert a string to a date format
Availability | Moments only |
---|---|
Format | toDate(stringValue, format) |
Input datatype | String, String |
Output datatype | Date |
Example | toDate("2009-09-24","yyyy-MM-dd")Output: 2009-09-24 |
toDateTime
Convert a string to a date time format.
Availability | Moments only |
---|---|
Format | toDateTime(stringValue, format) |
Input datatype | String, String |
Output datatype | DateTime |
Example | toDateTime("2009-09-24 12:34:56","yyyy-MM-dd HH:mm:ss")Output: 2009-09-24T11:34:56Z |
toString
Convert any input datatype to a string.
Availability | Moments only |
---|---|
Format | toString(stringValue, format) |
Input datatype | Any input datatype |
Output datatype | String |
Example | toString(123)Output: "123" |
toBool
Convert string text to a boolean value.
Availability | Moments only |
---|---|
Format | toBool(booleanValue) |
Input datatype | String |
Output datatype | Boolean |
Example | toBool("TRUE")Output: True |
Other operators
Generate pin
Generate a random sequence of alphanumeric symbols.
Availability | Moments only |
---|---|
Format | generatePin(lengthValue, isAlphanumeric) |
Input datatype | Integer, Boolean |
Output datatype | String |
Example | generatePin(10,true)Output: ABCD43E5H4
|
Brackets
You can use parentheses in complex, custom formulas to enforce the order of operators. This allows for the creation of highly complex formulas with limitless possibilities.