09.05- Reference Functions
Function Arguments into the bracket ([…]) are optional. Notice that, when you replace variables...
Written by
Updated August 3, 2021
Function Arguments into the bracket ([…]) are optional. Notice that, when you replace variables, e.g.: @(TIMEVALUE (flow.12_hour_time.category)), the quotation marks are necessary.
Date and Time Functions
DATE(year, month, day)
Defines the new data value, for example:
- This is the date @(DATE (2012, 12, 25))
DATEVALUE (text)
Converts stored date in a text to a real date, using the format date configuration of your organization, for example:
- You joined in @(DATEVALUE (contact.joined_date))
DAY (date)
Returns just the day of the month, for example:
- The actual day is @(DAY(contact.joined_date))
DAYS(“end_date”, “start_date”)
Returns how many days have between two dates.
- @(DAYS( “2016/02/28”, “2015/02/28”))
DATEDIF ( “start_date”, “END_DATE”, “units”)
Calculates how many days, months or years have between two dates.Units are abbreviate “D”, “M”, e “Y”.
- @(DATADIF ( “2015/02/26”, “2016/02/26”, “M”))**
EDATE (date, months)
Moves a date for the determined number of months, for example:
- The next meeting will be in @(EDATE (date.today, 1))
HOUR (DateTime)
Returns just the hour (0 to 23)
- The actual hour is @(HOUR (NOW ()))
MINUTE (DateTime)
Returns just the minutes (0 to 59), for example
- The actual minute is @(MINUTO (NOW ()))
SECOND(DateTime)
Returns just the seconds (0 a 59), for example:
- The current seconds are @(SECOND (NOW ()))
MONTH(Date)
Returns just the month (1 to 12), for example:
- The actual month is @(MONTH (NOW ()))
NOW()
Returns the actual date and time, for example:
- It is actually @(NOW ())
TIME(hour, minutes, seconds)
Defines a time value that can be used arithmetic time, for example:
- 2 hours e 30 minutes from now will be @((date.now + TIME (2, 30, 0)))
TIMEVALUE (text)
Converts the hour storage in text, for example:
- Your appointment is @((date.today + TIMEVALUE ( “2:30”)))
TODAY()
Returns the actual date, for example:
- Today is @(TODAY())
WEEKDAY(Date)
Returns the weekday (1 for Sunday to 7 for Saturday), for example:
- Today is @(WEEKDAY (DAY ())) in the week.
YEAR (Date)
Returns just the year, for example:
- The actual year is @(YEAR (NOW ())).
Logical Functions
AND (arg1, arg2, …)
Returns TRUE if and only if all arguments was evaluated as true, for example:
- @(AND (contact.gender = “F”, contact.age> = 18))
FALSO ()
Returns the logical value FALSE.
IF (arg1, arg2, …)
Returns the value if the condition was evaluated as TRUE, and another value was evaluated as FALSE, for example:
- Dear @(IF (contact.gender = “M”, “Mr.”, “Mrs.”))
OR (arg1, arg2, …)
Returns TRUE if any argument is TRUE, for example:
- @(OR (contact.state = “GA”, contact.state = “WA”, contact.state = “IN”))TRUE() Returns the logical value TRUE.
Math Functions
ABS (number)
Returns the absolute value from a number, for example:
- The -1 absolute value is @ (ABS (-1))
Average(number, …)
Returns the arguments average (arithmetic average).
MAX (arg1, arg2, …)
Returns the max value between all arguments, for example:
- Please, fill in, maximum @(MAX (flow.questions, 10)) questions.
MIN (arg1, arg2, …)
Returns the minimum value between all arguments, for example:
- Please, fill in, at least @((flow.questions, 10) MIN) questions.
POWER (number, potency)
Returns the result from a number elevate to a potency – equivalent to the operator ^, for example:
- 2 elevate to the third potency is @(POWER (2, 3)).
RAND ()
Returns an aleatory real number between 0 and 1, for example:
- 0,6160317611
RANDBETWEEN (number 1, number 2)
Returns an aleatory entire number between two numbers.
ROUND (number, how many digits)
Rounds a number to a number with a specific number of digits
- @(ROUND (9,4378, 3))
ROUNDDOWN (number, how many digits)
Rounds down the number to zero with a specific number of digits.
- @(ROUNDDOWN (9,4378, 3))
ROUNDUP (number, how many digits)
Rounds up a number to zero with a specific number of digits.
- @(Roundup (9,4378, 2))
SUM (arg1, arg2, …)
Returns the sum of all arguments, equivalent to the operator +, for example:
- You have @((contact.reports, contact.forms) Sum) reports and forms.
TRUNC (number)
Truncs a number to an integer number, removing the fractional part.
Text Functions
CHAR (number)
Returns the defined character for a number, for example:
- So easy as @(CHAR (65)), @(CHAR (66)), @(CHAR (67))
CLEAN(text)
Removes all characters not printable from text, for example:
- @(CLEAN(step.value))
CODE(text)
Returns a numerical code to the first character from text, for example:
- The A numerical code is @(CODE ( “A”))
CONCATENATE(args)
Concatenates texts in just one text, for example,
- Your name is @(CONCATENATE (contact.first_name, ” “, contact.last_name))
FIXED (number, [decimais], [no_commas])
Formats the given number to a decimal format, using a semicolon
- You have @ (FIXED(contact.balance, 2)) in your account.
INT (number)
Rounds down a number to the closest integer number.
LEFT (text, num_chars)
Returns the first characters in a text, for example:
- You get in PIN @(LEFT (step.value, 4))
LEN (text)
Returns how many characters are in a text, for example:
- You get in with @(LEN(step.value)) characters.
LOWER (text)
Converts text in lower case, for example:
- Welcome to @(LOWER (contact))
MOD (number, divider)
Returns the rest of the division.
PROPER (text)
Defines the first letter of each word as an upper case, for example:
- Your name is @(Proper (contact))
REPT (text, how many times)
Repeats the text in a determined number of times, for example:
- Stars! @(REPT( “*”, 10))
RIGHT (text, num_chars)
Returns the text last characters, for example:
- Your answer finished with… @(RIGHT(step.value, 3))
SUBSTITUTE (text, old_text, new_text, [num_ instância])
Substitutes NEW_TEXT to OLD_TEXT in a text. If the text was given, so just this text will be replaced, for example:
- @(SUBSTITUTE(step.value, “can not”, “can”))
UNICHAR(number)
Returns the character Unicode specified by a number, for example:
- So easy as @(UNICHAR (65)), @(UNICHAR (66)), @(UNICHAR (67))
UNICODE (text)
Returns a numerical code of the first character from the text, for example:
- The A numerical code is @(Unicode ( “A”))
UPPER (text)
Converts a text sequence in Upper case, for example:
- Welcome @(UPPER (contact)) !!
Platform Functions
These functions are specifics from the platform and are not found in the Excel, but was provided for convenience.
FIELD (text, index, [delimiter])
Refers to a field with a string split by a delimiter.
- @FIELD ( “Hello World”, 2 “,”)
FIRST_WORD (text)
Returns the first word of the given text, for example:
- The first word that you typed was @(FIRST_WORD (step.value))
PERCENT (number)
Formats a number as a percentage, for example:
- You completed @(PERCENT(contact.reports_done / 10)) reports
READ_DIGITS (text)
Formats the dialog in a text to read in TTS, for example:
- Your number is @(READ_DIGITS(contact.tel_e164))
REMOVE_FIRST_WORD (text)
Removes the first word from the given text. The rest of the text will not be altered, for example:
- You typed @(REMOVE_FIRST_WORD (step.value))
WORD (text, number, [by_spaces])
Extract the word from a text. If the number defined by a negative number, it is treated as a decrescent count starting at the end of the text. If the by_spaces specified as TRUE, so the function split the text in words just for spaces. On the contrary, the text is split for punctuation characters, for example:
- @ (WORD ( “Hello cow-boy”, 2)) will return “cow”
- @ (WORD ( “Hello cow-boy”, 2, TRUE)) will return “cow-boy”
- @ (WORD ( “Hello cow-boy”, -1)) will return “boy”
WORD_SLICE (text, start [stop], [by_spaces])
Extract a subchain of words that start in the beginner, until, but not including the STOP. If STOP is omitted so the substring will be all words from the beginner to the end of the text. If the stop is a negative number, he is treated as a decrescent count from the end of the text. If by_spaces is specified and this is true, so the function split the text in words just for spaces. On the contrary, the text is split by punctuation characters, for example:
- @(WORD_SLICE ( “IlhaPush expressions are fun”, 2, 3)) returns the 2º and 3º words “expressions are”
- @ (WORD_SLICE ( “IlhaPush expressions are fun”, 2)) returns “expressions are fun”
- @ (WORD_SLICE ( “IlhaPush expressions are fun ”, 1, -2)) returns “IlhaPush expressions”
- @ (WORD_SLICE ( “IlhaPush expressions are fun”, -1)) returns “fun”
Problems Solution
Why is only part of my expression evaluated? If the expression is not the only function or variable call, so you should put them into the brackets the platform know where it starts and finishes, for example,
- @ (SUM (contact.reports, step.value)) * 2 <- o “* 2” is not evaluated, should be written as:
- @ (SUM (contact.reports, step.value) * 2)