Operators
| Operator | Description | Example |
|---|---|---|
+ | Adds two fields | 10+2 is 12 |
- | Subtracts two fields | 10-3 is 7 |
* | Multiplies two fields | 5*20 is 100 |
/ | Divides two fields | 20/5 is 4 |
% | Calculates the remainder | 20%3 is 2 |
( | Used to define mathematical formulas or conditional operations | (10+2)*3 |
) | Used to define mathematical formulas or conditional operations | (10-2)*4 |
! | Condition is negated | !{{Contact.billingcountry}}=‘USA’ |
!= | Not equal to operator | {{Contact.billingCountry}}!=‘USA’ |
= | Equal to operator | {{Contact.billingCountry}}=‘USA’ |
< | Less than operator | {{Deal.value}}<1000 |
> | Greater than operator | {{Deal.value}}>1000 |
<= | Less than or equal to operator | {{Deal.value}}<=1000 |
>= | Greater than or equal to operator | {{Deal.value}}>=1000 |
Functions
| Function | Description |
|---|---|
abs | Returns the absolute value |
ceil | Rounds a value to the nearest higher integer |
floor | Rounds a value to the nearest lower integer |
max | Returns the greater of two values |
min | Returns the smaller of two values |
sqrt | Returns the square root of the input number |
if | Returns one of two values depending on the logical condition |
len | Returns the number of characters in the provided text |
dayofmonth | Returns the day of the month for the given date |
hour | Returns the hour for the given date |
minute | Returns the minute for the given date |
month | Returns the month for the given date |
year | Returns the year for the given date |
weekday | Returns the day of the week (1-7) corresponding to the input date, where 1 is Sunday, 2 is Monday, and so on. |
&& | Returns true when both conditions match |
| | | |
Returns true when any condition matches |
lower | Converts all characters in a text to lowercase |
upper | Converts all characters in a text to uppercase |
trim | Removes extra spaces before and after the text |
substring | Returns the part of text from the start position to the given length |
tostring | Returns string representation of the object |
replace | Replaces a character every time it appears in the text |
newdate | Creates a date from the year, month, day, and time |
datepart | Returns just the date for the DateTime value |
timepart | Returns just the time for the DateTime value |
adddate | Returns a new date by adding (year/day/month/hour/min) to the given date |
subdate | Returns a new date by subtracting (year/day/month/hour/min) from the given date |
now | Returns a date/time representing the current time |
datecomp | Compares two dates and returns the difference of days in minutes |
tonumber | Returns a number from the given string |
Date Time Functions
| Function | Internal | Help Tooltip |
|---|---|---|
newdate | newdate(year, month, day, hour, minute, am/pm) | Creates a date from the year, month, day, and time. e.g. newdate(2020, 02, 01, 06, 30, ‘PM’) gives 01/02/2020 06:30 PM |
datepart | datepart(date-time) | Returns just the date for the DateTime value. e.g. datepart(newdate(2020,02,03,06,30,‘PM’)) returns “03/02/2020” |
timepart | timepart(date-time) | Returns just the time for the DateTime value. e.g. timepart(newdate(2020,02,03,06,30,‘PM’)) returns “06:30 PM” |
adddate | adddate(datetime, number, ‘date period’) | Returns a new date by adding (year/day/month/hour/min) to the given date. e.g. adddate(newdate(2020,02,03,06,30,‘PM’), 2, ‘month’) returns 03/04/2020 06:30 PM |
subdate | subdate(datetime, number, ‘date period’) | Returns a new date by subtracting (year/day/month/hour/min) from the given date. e.g. subdate(newdate(2020,02,03,06,30,‘PM’), 2, ‘month’) returns 03/12/2019 06:30 PM |
now | now() | Returns a date/time representing the current time. |
datecomp | datecomp(date time 1, date time 2) | Compares two dates and returns the difference of days in minutes. |
dayofmonth | dayofmonth(datetime) | Returns the day of the month. e.g. dayofmonth(newdate(2020,02,03,06,30,‘PM’)) returns 03. |
hour | hour(datetime) | Returns the hour for the given date. e.g. hour(newdate(2020,02,03,06,30,‘PM’)) returns 18. |
minute | minute(datetime) | Returns the minute for the given date. e.g. minute(newdate(2020,02,03,06,30,‘PM’)) returns 30. |
month | month(datetime) | Returns the month. e.g. month(newdate(2020,02,03,06,30,‘PM’)) returns 02. |
year | year(datetime) | Returns the year. e.g. year(newdate(2020,02,03,06,30,‘PM’)) returns 2020. |
weekday | weekday(datetime) | Returns the day of the week (1–7) corresponding to the input date, where 1 is Monday, 2 is Tuesday, and so on. (Ex: Friday returns ‘5’) |
Conditional & Logical Operators
| Function | Internal | Usage | Help Tooltip |
|---|---|---|---|
if | Conditional | if(logical_condition, value_if_true, value_if_false) | Returns one of two values depending on the logical condition. e.g.if({{Contact.billingCountry}}=‘USA’,‘Yes’,‘No’)returns Yes if the country is USA. |
&& | And operator | ( {{Contact.billingCountry}} == ‘USA’ &&
{{Deal.value}} > 5000 ) | Returns true when both conditions match. |
| | | | | Or operator | | ( {{Contact.billingCountry}} == ‘USA’ |
{{Contact.billingCountry}} == ‘Canada’ ) | Returns true when any condition matches. |