Expression language
Expression Language reference

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. Learn more here.
  • [Operators] - determine the action to be performed and can be arithmetic, logical, or a comparison. Learn more here.
  • [Brackets] - these determine the order of operations and allow for the grouping of functions and operators to build complex, custom formulas. Learn more here.

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 can use functions whenever you are building your formula in the web interface.

The following functions are available:

String functions

Len

The len function 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.

AvailabilityAvailable in Moments and People
Formatlen(stringValue)
Input data typeString
Output data typeInteger
Examplelen("infobip.com")
Output: 11

Find

The find function 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.

AvailabilityAvailable in Moments and People
Formatfind(stringValue, search)
Input data typeString, String
Output data typeInteger
ExampleThe firstName attribute of a profile for a user called Andrea:
find(First Name, "a") will output the number 5 for Andrea
find(First Name, "A") will output 0 for Andrea.
If no substring is matched using the find() function, then the output will be -1
find(First Name, "b") will output -1 for Andrea

Replace

The replace function is 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.

AvailabilityMoments only
Formatreplace(stringValue, oldValue, newValue)
Input data typeString, String, String
Output data typeString
Examplereplace( "I love cats", "cats", "dogs")
Output: I love dogs

Trim

The trim function trims spaces, newlines, and tabs from both ends of a string.

AvailabilityMoments only
Formattrim(stringValue)
Input data typeString
Output data typeString
Exampletrim(" abc ")
Output: abc

Left

The left function 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.

For example, left(city ,4). If the city attribute is London then the output would return the first 4 characters of London: Lond.

AvailabilityAvailable in Moments and People
Formatleft(stringValue, count)
Input data typeString, Integer
Output data typeString
Exampleleft("I love cats",5)
Output: I lov

Right

The right function 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.

AvailabilityAvailable in Moments and People
Formatright(stringValue, count)
Input data typeString, Integer
Output data typeString
Exampleright("I love cats",4)
Output: cats

Mid

The mid function 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 the 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.

For 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.

AvailabilityAvailable in Moments and People
Formatmid(stringValue, offsetValue, countValue)
Input data typeString, Integer, Integer
Output data typeString
Examplemid("I love cats",2,4)
Output: love

Concatenate

The concatenate function 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 the firstName attribute is Edward and lastName attribute is Jones, then the output would be Edward Jones.

AvailabilityAvailable in Moments and People
Formatconcat(stringValue 1, stringValue 2, stringValue n...)
Input data typeString, String, String, ... n;
Output data typeString
Exampleconcat("I", " Love ", "Cats")
Output: I Love Cats

Contains

The contain function is a text search within a string (appears somewhere inside the string). Use contains() to identify case sensitive text from within a larger body of text.

AvailabilityMoments only
Formatcontains(stringValue, search)
Input data typeString, String
Output data typeBoolean
Examplecontains("CAT,dad,Frog,doggybag,hotdog","dog")
Output: True
contains("CAT,Frog,doggybag,hotdog","bird")
Output: False

Starts with

Use the startsWith() function to determine whether a string starts with the characters of a particular string.

AvailabilityMoments only
FormatstartsWith(stringValue, search)
Input data typeString, String
Output data typeBoolean
ExamplestartsWith("Josephine","Jo")
Output: True

Ends with

Use the endsWith() function to determine whether a string ends with the characters of a particular string.

AvailabilityMoments only
FormatendsWith(stringValue, search)
Input data typeString, String
Output data typeBoolean
ExampleendsWith("Josephine","Jo")
Output : False

leftPad

Use the leftPad function 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.

AvailabilityMoments only
FormatleftPad(original string, size integer, padding string)
Input data typeString, Integer, String
Output data typeString
ExampleleftPad("15", 6, "0")
Output: 000015
leftPad("15", 7, "02")
Output: 0202015

Date/Time functions

Now

Use the now() function to return the current time (local) in the DateTime format.

AvailabilityMoments only
Formatnow()
Input data type-
Output data typeDateTime
Examplenow()
Output: YYYY-MM-DD THH:mm:ssZ; e.g., 2009-09-24T11:34:56Z

Today

Use the today() function to return todays date (without time) in the 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.

AvailabilityMoments only
Formattoday()
Input data type- / String
Output data typeDate
Example

today()
today("+2")
today("-0230")
today("+02:30")

Output: YYYY-MM-DD

Date add

Use addDays/addMonths, etc., to add an integer amount to a date or time.

addHours, addMinutes, and addSeconds operators output in Date Time. Other addDate operators output Date Time/Date. You can 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

AvailabilityMoments only
FormataddDays(dateTimeValue, amount), addHours(dateTimeValue, amount), addMinutes(dateTimeValue, amount), addSeconds(dateTimeValue, amount), addWeeks(dateTimeValue, amount), addMonths(dateTimeValue, amount), addQuarters(dateTimeValue, amount), addYears(dateTimeValue, amount)
Input data typeDateTime or Date, Integer
Output data typeDateTime or Date
ExampleaddDays(toDate("2009-09-24", "yyyy-MM-dd"), 4)
Output: 2009-09-28
addDays(toDate("2009-09-24", "yyyy-MM-dd"), -4)
Output: 2009-09-20

Date diff

The dateDiff function 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. 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.

For example, dateDiff(firstOrderDate, lastOrderDate) would return the difference in days between the two dates.

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 the round() function to round the decimal number.

AvailabilityAvailable in Moments and People
FormatdateDiff(dateValue 1, dateValue 2, [string])
Input data typeDateTime or Date, DateTime or Date, String
Output data typeDecimal
ExampledateDiff(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: 1
dateDiff(toDate("2016-01-12", "yyyy-M-d")
toDate("2016-01-11", "yyyy-M-d"), "hours")
Output: 24
dateDiff(toDate("2016-01-12", "yyyy-M-d")
toDateTime("2016-01-12 00:10:00", "yyyy-M-d HH:mm:ss")<br />"minutes")
Output: 10
The toDate or toDateTime functions are not currently available for use in People. Use dateDiff with attributes like dateDiff(Purchase Date, Delivery Date)

Year

The year function 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.

For example, if the Birth Date attribute is 04/12/1974. year(Birth Date) expression would output 1974.

AvailabilityAvailable in Moments and People
Formatyear(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
Exampleyear(toDate("1981-07-12", "yyyy-MM-dd"))
Output: 1981
The 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

The quarter function 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.

For example, if the purchaseDate attribute is 04/12/2020 then the output of quarter (purchaseDate) would be 4.

AvailabilityAvailable in Moments and People
Formatquarter(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
Examplequarter(toDate("1981-07-12", "yyyy-MM-dd"))
Output: 3
The 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

The month function returns the month as a whole number (1-12) for a dt date/datetime profile attribute.

For example, if a user's Birth Date attribute is 04/12/1974, then the expression month(Birth Date) would output 12.

AvailabilityAvailable in Moments and People
Formatmonth(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
Examplemonth(toDate("1981-07-12", "yyyy-MM-dd"))
Output: 7
The 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's Birth Date attribute is 04/12/1974, then the expression day(Birth Date) would output 4.

AvailabilityAvailable in Moments and People
Formatday(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
Exampleday(toDate("1981-07-12", "yyyy-MM-dd"))
Output: 12
The 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

The hour function 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.

If deliveryDate is 2020-07-12 11:22:56, then the output would be 11.

AvailabilityAvailable in Moments and People
Formathour(dateTimeValue)
Input data typeDateTime 
Output data typeInteger
Examplehour(toDateTime("1981-07-12 11:22:56", "yyyy-M-d HH:mm:ss"))
Output: 11
The toDate or toDateTime functions are not currently available for use in People. Use hour with date and time attributes like hour(Last Purchase Date) to show which hour the purchase was made.

Minute

The minute function returns the minute of a given (date)time or profile attribute.

AvailabilityMoments only
Formatminute(dateTimeValue)
Input data typeDateTime 
Output data typeInteger
Exampleminute(toDateTime("1981-07-12 12:34:56", "yyyy-M-d HH:mm:ss"))
Output: 34

Second

The second function returns the second of a given (date)time (or profile attribute).

AvailabilityMoments only
Formatsecond(dateTimeValue)
Input data typeDateTime 
Output data typeInteger
Examplesecond(toDateTime("1981-07-12 12:34:56", "yyyy-M-d HH:mm:ss"))
Output: 56

Day of year

The dayofYear function 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, e.g., New Year's Day or Black Friday.

For example, if the purchaseDate attribute is 2020-07-12 11:22:56 then the dayOfYear(purchaseDate) output would be 193.

AvailabilityAvailable in Moments and People
FormatdayOfYear(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
ExampledayOfYear(toDate("2021-10-12", "yyyy-M-d"))
Output: 193
The 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

The dayofWeek function 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.

AvailabilityAvailable in Moments and People
FormatdayOfWeek(dateTimeValue)
Input data typeDateTime or Date
Output data typeInteger
ExampledayOfWeek(toDate("2021-10-12", "yyyy-M-d"))
Output: 3
The 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

The formatDateTime function takes date time as input and returns string with formatted date time. The user setup requires a format specified as the second attribute, with support for unix format. Additional formats can be defined by the user based on masks and components.

  • d: The day of the month, from 1 to 31.
  • dd: The day of the month, from 01 to 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 to 59.
  • mm: The minute, from 00 to 59.
  • M: The month, from 1 to 12.
  • MM: The month, from 01 to 12.
  • MMM: Name of the month abbreviated.
  • MMMM: The full name of the month.
  • s: The second, from 0 to 59.
  • ss: The second, from 00 to 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.
AvailabilityMoments only
FormatformatDateTime(dateTimeValue, formatValue)
Input data typeDateTime or Date
Output data typeInteger
ExampleformatDateTime(toDateTime("2021-08-03 14:05:13", "yyyy-M-d HH:mm:ss"), "unix")
Output: 1627988713
formatDateTime(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 Tue
The toDate or toDateTime functions are not currently available for use in People.

Format date

The formatDate function takes date as an input and returns a string with the 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 to 31.
  • dd: The day of the month, from 01 to 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 to 12.
  • MM: The month, from 01 to 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.
AvailabilityMoments only
FormatformatDate(date, formatValue)
Input data typeDate, String
Output data typeString
ExampleformatDate(toDate("2007-04-05", "yyyy-MM-dd"), "dd.MM.yyyy")
Output: 05.04.2007
formatDate(toDate("05/04/2007", "dd/MM/yyyy"), "yyyy-MM-dd")
Output: 2007-04-05
The 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, e.g., 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.

AvailabilityAvailable in Moments and People
Formatabs(decimalValue)
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Exampleabs(5)

Output: 5
abs(-5)

Output: 5

Add

Add values together using +.

For example, the expression 1 + 2 + 3 would output 6.

AvailabilityAvailable in Moments and People
Format+
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Example1 + 2 + 3
Output: 6

Subtract

Subtract values from another value using -.

For example, the expression 5 - 3 would output 2.

AvailabilityAvailable in Moments and People
Format-
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Example5 - 3
Output: 2

Divide

Divides values using /.

For example, the expression 4 / 2 would output 2.

AvailabilityAvailable in Moments and People
Format/
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Example4 / 2
Output: 2

Multiply

Multiplies values using \*.

For example, the expression 2 \* 2 would output 4.

AvailabilityAvailable in Moments and People
Formatx
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Example2 * 2
Output: 4

Modulo

Returns the modulo (remainder) of a divided value.

For example, the expression 12 % 8 would output 4.

AvailabilityAvailable in Moments and People
Format%
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Example12 % 8
Output: 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, and round to the nearest whole number.

For example, the expression round(1.23456, 3) would round up to 3 decimal places. The result is 1.235.

AvailabilityAvailable in Moments and People
Formatround(decimalValue, scale)
Input data typeDecimal or Integer, Integer
Output data typeDecimal or Integer (dependent on input data type)
Exampleround(1.23456,3)
Output: 1.235

Floor

Returns the value of num rounded down to the nearest integer value.

The expression floor(1.2345) would output 1.

AvailabilityAvailable in Moments and People
Formatfloor(decimalValue)
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Examplefloor(1.2345)
Output: 1

Ceil

Returns the value of num rounded up to the nearest integer value.

The expression ceil(1.7) would output 2.

AvailabilityAvailable in Moments and People
Formatceil(decimalValue)
Input data typeDecimal or Integer
Output data typeDecimal or Integer (dependent on input data type)
Exampleceil(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.

AvailabilityAvailable in Moments and People
Format==
Input data typeAny input data type
Output data typeBoolean
ExampleA == 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.

AvailabilityAvailable in Moments and People
Format!=
Input data typeAny input type
Output data typeBoolean
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.

AvailabilityAvailable in Moments and People
Format>
Input data typeDecimal or Integer
Output data typeBoolean
Example1 > 5
Output: 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.

AvailabilityAvailable in Moments and People
Format>=
Input data typeDecimal or Integer
Output data typeBoolean
Example1 >= 5
Output: 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.

AvailabilityAvailable in Moments and People
Format<
Input data typeDecimal or Integer
Output data typeBoolean
Example1 < 5
Output: 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.

AvailabilityAvailable in Moments and People
Format<=
Input data typeDecimal or Integer
Output data typeBoolean (True / False)
Example1 <= 5
Output: 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.

For example, the expression (1==5) and (Gender=='m') would output False.

AvailabilityAvailable in Moments and People
Formatand
Input data typeBoolean
Output data typeBoolean
Example(1==5) and (3==4)
Output: False

Or

The or operator returns False if both operands are False, and returns True otherwise.

An example expression could be (5 ==5) or (Gender == "m") which would output True.

AvailabilityAvailable in Moments and People
Formator
Input data typeBoolean
Output data typeBoolean
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.

AvailabilityAvailable in Moments and People
Formatnot
Input data typeBoolean
Output data typeBoolean
Examplenot(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.

AvailabilityMoments only
Formatif(predicate, option1, option2)
Input data typeBoolean, option1 (data types: True/False/Date Time/Date/Decimal Number/Whole Number/Text), option2 (data types: True/False/Date Time/Date/Decimal Number/Whole Number/Text)
Output data typeOutput data type will be the same as the data type chosen at Input.
Exampleif(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 married.

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.

AvailabilityMoments only
FormatisEmpty(any)
Input data typeAny input data type
Output data typeBoolean
ExampleisEmpty(BirthDate)
Output: True, if no value exists for the attribute/variable

Conversion operators

toInt

Converts a decimal, integer or string to integer.

AvailabilityMoments only
FormattoInt(decimalValue)
Input data typeDecimal or Integer or String
Output data typeInteger
ExampletoInt("123.345")
Output: 123toInt(NULL) Output: 0

toDecimal

Converts a decimal, integer or string to decimal.

AvailabilityMoments only
FormattoDecimal( string text)
Input data typeDecimal or Integer or String
Output data typeDecimal
ExampletoDecimal("123.345")
Output: 123.345 toDecimal(NULL) Output: 0

toDate

Converts a string to a date format.

AvailabilityMoments only
FormattoDate(stringValue, format)
Input data typeString, String
Output data typeDate
ExampletoDate("2009-09-24","yyyy-MM-dd")
Output: 2009-09-24

toDateTime

Converts a string to a date time format.

AvailabilityMoments only
FormattoDateTime(stringValue, format)
Input data typeString, String
Output data typeDateTime
ExampletoDateTime("2009-09-24 12:34:56","yyyy-MM-dd HH:mm:ss")
Output: 2009-09-24T11:34:56Z

toString

Converts any input data type to a string.

AvailabilityMoments only
FormattoString(stringValue, format)
Input data typeAny input data type
Output data typeString
ExampletoString(123)
Output: 123

toBool

Converts string text to a Boolean value.

AvailabilityMoments only
FormattoBool(booleanValue)
Input data typeString
Output data typeBoolean
ExampletoBool("TRUE")
Output: True

Other operators

Generate pin

Generates a random sequence of alphanumeric symbols.

AvailabilityMoments only
FormatgeneratePin(lengthValue, isAlphanumeric)
Input data typeInteger, Boolean
Output data typeString
ExamplegeneratePin(10,true)
Output: ABCD43E5H4


generatePin(4,false)

Output: 6752

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.

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use