In an ICApp you can apply Formulas to extract, format or process your data as they flow in the workflow. It’s like when you work with spreadsheet software such as MS Excel you can use formulas built-in functions like sum(…), power(…), concatenate(…) …etc. For example you can use formulas in ICApps that do following functionality

  • Concatenate first & last name to create full name. e.g. contact({{#firstName}}, {{#lastName}}). Here {{#firstName}} & {{#lastName}} are two macros that resolve into firstName & lastName values that coming from previous step of your ICApp each time it’s executed.
  • When using email as an action you can add date & time to your email content to specify date(), time() functions.

String Functions

Function Description
to_lower( ) Convert a string to lower case
to_upper( ) Convert a string to upper case
to_caps( ) Capitalize a string
trim( ) Remove leading and trailing whitespaces from a string
to_str( ) Convert Numbers, JSON, Boolean values to their string form
is_empty( ) Check if a string is empty
length( ) Returns length of the string
concat( s1, s2) Concatanate two strings
matches( s, regex) Check if the string matches a given regex
mstart( s, prefix) Check if a string starts with the given prefix
mend( s, suffix) Check if a string ends with the given suffix
substr( s, start, end) Get a substring from start index to end index, note that first character of the string is at 0th index.
extract( s, regex) Extract all matching strings, for a given regex, in the string given as first argument to the function and produce the results as a json array
replace( s, what, rep) Replace the first occurence of what found in the given string with the rep string
replace_all( s, what, rep ) Replace ALL the occurences of what found in the given string with the rep string

Date Functions

All date & time functions unless specified a timezone uses UTC to avoid any regional differences.

Function Description
date() Today’s date as at UTC
time() Time as at UTC
time24h() Time as at UTC in 24h format
datetime() Date & time as at UTC
timestamp() Timestamp in number of seconds from the epoch of 1970-01-01T00:00:00Z
date_at( ) Today’s date at a given timezone
time_at( ) Time at a given timezone
datetime_at( ) Date & time at a given timezone
to_datetime( ) Convert ISO date time string to a format suitable for processing
ex_date( ) Extract date from ISO format
ex_time( ) Extract time from ISO format

Math Functions

Function Description
abs( ) Get absolute value of a Number
ceiling( ) Get the least integer number greater than or equal to the given number
floor( ) Get the greatest integer less than or equal to the given number
max( x, y) Get the greater of the two values x & y
min( x, y) Get the smallest of the two values x & y
pow( x, y) Get x value raised to the power of y value
round( ) Get rounding off value for the given argument
sum( x, y) Get summation of two x & y
to_num( ) Convert string value to it’s number format number

Other Functions

Function Description
to_json( ) Convert JSON to a it’s string form - i.e. stringify
base64( ) Generate Base 64 value of a given string
uuid() Generate random UUID.
url_enc( ) Encode a given URL fragment to a URL safe form
md5( ) Generate MD5 value of a given string

Regular Expressions Reference

General Rules

\   Escape the next character. 
^   The beginning of a line 
$   The end of a line 
.   Match any single character except newline. When in [] class it means period
|   Alternation
()  Grouping 
[]  Character class
-   Range in a Character class e.g. [a-z] or [0-9]
*   0 or more times
+   1 or more times
?   0 or 1 times
{n} n number of times

POSIX character classes (US-ASCII only) 
\p{Lower} A lower-case alphabetic character: [a-z] 
\p{Upper} An upper-case alphabetic character:[A-Z] 
\p{ASCII} All ASCII:[\x00-\x7F] 
\p{Alpha} An alphabetic character:[\p{Lower}\p{Upper}] 
\p{Digit} A decimal digit: [0-9] 
\p{Alnum} An alphanumeric character:[\p{Alpha}\p{Digit}] 
\p{Punct} Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ 
\p{Graph} A visible character: [\p{Alnum}\p{Punct}] 
\p{Print} A printable character: [\p{Graph}\x20] 
\p{Blank} A space or a tab: [ \t] 
\p{Cntrl} A control character: [\x00-\x1F\x7F] 
\p{XDigit} A hexadecimal digit: [0-9a-fA-F] 
\p{Space} A whitespace character: [ \t\n\x0B\f\r] 

Last modified August 17, 2022