Flow Expression Operators
You can use expressions and operators in your flow notation parameters to design robust interaction flows that behave in certain ways depending on their configuration.
This table includes examples of some common expressions that you can use with your flow.
This list is a work in progress. We are working to improve and add to it on a regular basis. If an expression that you're looking for isn't currently listed, please check back on an ongoing basis. 
 Common Operators
 String Operators
 Arithmetic Operators
 Math Operators
 Number Comparison Operators
 UUIDs
 Phone Number Operators
 Date and Time Operators
 Date and Time Periods
 Date and Time Predicates and Comparators
 Date and Time Conversion
 Date and Time Formatting
 Maps
 Lists
 Control
 Comparator Operators
Operator  Description 

Common Operators  
count (count coll) 
Returns the number of items in the collection.

String Operators  
(regex patterns s) 
Checks if a string matches a pattern and returns a true response if it does and false if not.

str (str arg1 arg2 ....) 
Links all arguments to a string. The example provided represents the argument fields by the arg values.

subs (subs s start) (subs s start end) 
Returns the substring of the value used for s beginning at start (inclusive), and ending at end (exclusive). The end defaults to the length of the string.

join (join coll) (join separator coll) 
Returns a string of all of the elements in a collection, as returned by (seq coll), separated by an operational separator.

escape (escape s cmap) 
Returns a new string, using cmap to escape each character (ch) from s as follows:

split (split s separator) (split s separator limit) 
Splits a string into a list of strings with a separator.

splitlines (splitlines s) 
Splits the value for s on \n or \r\n.

replace (replace s match replacement) 
Replaces all instances of the value used for match with the value used for replacement in s.

replacefirst (replacefirst s match replacement) 
Replaces the first instance of the value used for match with the value used for replacement in s.

requotereplacement (requotereplacement replacement) 
Given a replacement string that you wish to be a literal replacement for a pattern match in replace or replacefirst, do the necessary escaping of special characters in the replacement. 
reverse (reverse s) 
Returns the value for s with it's characters reversed.

indexof (indexof s value) (indexof s value fromindex) 
Returns the index of the string or character value for s. Optionally, you search forwards from fromindex point or nil if not found.

lastindexof (last indexof s value) (lastindexof s value fromindex) 
Returns the last index of the string or character value for s. Optionally, you can search backwards from fromindex point or nil if not found.

capitalize (capitalize s) 
Converts the first character of the string value to upper case and keeps all other characters lower case.

lowercase (lowercase s) 
Converts the entire string to lower case characters.

uppercase (uppercase s) 
Converts the entire string to upper case characters.

trim (trim s) 
Removes any white space from both ends of the string.

trimnewline (trimnewline s) 
Removes any trailing newline (\n) or return (\r) characters from the string.

triml (triml s) 
Removes any white space from the left side of the string.

trimr (trimr s) 
Removes any white space from the right side of the string.

render (render s) 
Renders a mustache template with the current environment, using any assigned variables. If the variable is missing, the place holder will be resolved to an empty string as with the {{greeting}} variable below.

string? (string? x) 
Returns as true if the value for x is a string.

blank? (blank? s) 
Returns as true if the value for s is nil, empty, or contains only white space.

startswith? (startswith? s substr) 
Returns as true if the string (s) starts with the substring (substr) provided.

endwith? (endswith? s substr) 
Returns as true if the string (s) ends with the substring (substr) provided.

includes? (includes? s substr) 
Returns as true if the string (s) includes the substring (substr) provided.

Return to Top  
Arithmetic Operators  
+ (+) (+ x) (+ x y) (+ x y & more) 
Returns the sum of numbers.

 ( x) ( x y) ( x y & more) 
Subtracts the y's from x and returns the result.

* (*) (* x) (* x y) (* x y & more) 
Returns the product of the numbers.

/ (/ x) (/ x y) (/ x y & more) 
Returns the numerator divided by all of the denominators.

quot (quot num div) 
Returns the quotient of dividing the numerator by the denominator.

rem (rem num div) 
Returns the remainder of dividing the numerator by the denominator.

(mod num div) 
Returns the modulus of num and div.

inc (inc x) 
Returns a number one greater than num.

dec (dec x) 
Returns a number one less than the num.

max (max x) (max x y) (max x y & more) 
Returns the greatest of the nums.

min (max x) (max x y) (max x y & more) 
Returns the least of the nums.

+' (+') (+' x) (+' x y) (+' x y & more) 
Returns the sum of the numbs.

' (' x) (' x y) (' x y & more) 
Subtracts the y's from x and returns the result.

*' (*') (*' x) (*' x y) (*' x y & more) 
Returns the product of the numbers.

inc' (inc' x) 
Returns a number one greater than num.

dec' (dec' x) 
Returns a number one less than the num.

Return to Top  
Math Operators  
rand (rand) (rand n) 
Returns a random floating point number between 0 (inclusive) and n (default 1) (exclusive).

randint (randint n) 
Returns a random integer between 0 (inclusive) and n (exclusive).

abs (abs x) 
Returns the absolute value of x.

floor (floor x) 
Returns x, rounded down to the nearest integer.

ceiling (ceiling x) 
Returns x, rounded up to the nearest integer.

round (round x y) 
If the fractional portion of x is 0.5 or greater, the argument is rounded up to the nearest integer. If the fractional portion of x is less than 0.5, the argument is rounded down to the nearest integer.

Return to Top  
Number Comparison Operators  
zero? (zero? x) 
Returns true if num is zero, otherwise it's false.

pos? (pos? x) 
Returns true if num is greater than zero, otherwise it's false.

neg? (nex? x) 
Returns true if num is less than zero, otherwise it's false.

even? (even? n) 
Returns true if n is even, otherwise it's false.

odd? (odd? n) 
Returns true if n is odd, otherwise it's false.

number? (number? x) 
Returns true if x is a number.

rational? (rational? n) 
Returns true if n is a rational number, otherwise it's false. 
integer? (integer? n) 
Returns true if n is an integer, otherwise it's false.

ratio? (ratio? n) 
Returns true if n as a ratio, otherwise it's false. 
decimal? (decimal? n) 
Returns true if n is a BigDecimal, otherwise it's false. 
float? (float? n) 
Returns true if n is a floating point number, otherwise it's false. 
sort (sort coll) (sort comp coll) 
Returns a sorted sequence of the items in the collection (coll). It checks to see if a string matches on a pattern and returns true/false. 
sortby (sortby key coll) (sortby key comp coll) 
Returns a sorted sequence of the items in the collection (coll), where the sort order is determined by comparing the key value of each item. 
Return to Top  
UUIDs  
asuuid

The asuuid function will allow the conversion (and also verification) of a string to a uuid object. If the passed object is already a uuid, the same object will be returned.

uuidv1 
The uuidv1 function will return a new v1 UUID. The value returned will be a UUID, not a string.

uuidable? (uuidable? x) 
Returns true if x can be coerced into a uuid, otherwise it's false.

uuid? (uuid? x) 
Returns true if x is a uuid, otherwise it's false.

Return to Top  
Phone Number Operators  
phonenumber (phonenumber number) (phonenumber number locale) 
Parses a string telephone number into a map of different formats.

Return to Top  
Date and Time Operators  
daysthismonth (daysthismonth) 
Returns the number of days in the current month.

daysinmonth (daysinmonth date) 
Returns the number of days in the month of a specified date.

now (now) 
Returns the current date and time. 
today (today) 
Returns today's date.

todayatmidnight (todayatmidnight) 
Returns the date and time as of midnight today. 
yesterday (yesterday) 
Returns the date for yesterday.

tomorrow (tomorrow) 
Returns the date for tomorrow.

ago (ago t) 
Returns the date and time as it was t seconds/minutes/hours/days/months/years ago. 
fromnow (fromnow t) 
Returns the date and time that it will be in t seconds/minutes/hours/days/months/years from now. 
second (second t) 
Returns the seconds portion of a date specified by t. 
minute (minute t) 
Returns the minutes portion of a date specified by t. 
hour (hour t) 
Returns the hour portion of a date specified by t. 
day (day t) 
Returns the day of the month in a date specified by t. 
month (month t) 
Returns the month portion of a date, specified by t, as number.

quarter (quarter t start) 
Returns the quarter of a date along with the year. The start is the number of the month in the year that you want the quarters to start in. If no start is specified, then January (1) is used as the start of the quarters. For example, if the start = 1 or isn't specified, returns the year along with:
Alternatively, if the start = 5, returns the year along with:

year (year t) 
Returns the year portion of a date specified by t. 
dayofweek (dayofweek t) 
Returns the numeric value for the day of the week for a given date (t), between 1 and 7, where Sunday is considered 1 and the first day of the week. 
weekofyear (weekofyear t) 
Returns the number value for the week of the year for a given date (t). 
endofmonth (endofmonth t) 
Returns the numeric value for the last day of the month (t). 
beginningofmonth (beginningofmonth t) 
Returns the numeric value for the beginning of the month (t). 
atmidnight (atmidnight t) 
Returns the date/time at midnight for a given date (t). 
ampm (ampm t) 
Returns am if the current time is between 00:00 inclusive and 12:00 exclusive. Returns pm if the current time is between 12:00 inclusive and 00:00 exclusive.

timezoneoffset (timezoneoffset d) (timezoneofset d d2) 
Returns the offset between a date (d) and another (d2).

interval (interval date1 date2) 
Returns the interval between date1 and date2.

Return to Top  
Date and Time Periods  
seconds (seconds t) 
Returns a date considered to be that many seconds. 
minutes (mintues t) 
Returns a date considered to be that many minutes. 
hours (hours t) 
Returns a date considered to be that many hours. 
days (days t) 
Returns a date considred to be that many days. 
months (months t) 
Returns a date considered to be that many months. 
quarters (quarters t) 
Returns a date considered to be that many quarters.

years (years t) 
Returns a date considered to be that many years. 
inseconds (inseconds p) 
Returns the number of seconds in a given period.

indays (indays p) 
Returns the number of days in a given period.

inweeks (inweeks p) 
Returns the number of weeks in a given period.

inmonths (inmonths p) 
Returns the number of months in a given period.

inyears (inyears p) 
Returns the number of years in a given period.

Return to Top  
Date and Time Predicates and Comparators  
after? (afetr? a b) 
Returns true if a comes after b, otherwise it is false.

before? (before? a c) 
Returns true if a occurs after b, otherwise it is false.

within? (within? a b c) 
Returns true if b occurs after a and before c, otherwise it is false.

earliest (earliest a b c & more) 
Returns the earliest date/time in a given list of date/times.

latest (latest a b c & more) 
Returns the latest date/time in a given list of date/times.

Return to Top  
Date and Time Conversion  
unixtimestamp (unixtimestamp s) 
Converts s to an unix timestamp.

timestamp (timestamp s) 
Converts s to a datetime object.

Return to Top  
Date and Time Formatting  
formatdate (formatdate t) (formatdate formatter t) 
Given a date, returns the date in a specified format.
Click here for a list of built in formatters.
Click on the thumbnail to expan the image, or see the text versions below: :basicdate 20160520 :basicdatetime 20160520T035923.662Z :basicdatetimenoms 20160520T035923Z :basicordinaldate 2016141 :basicordinaldatetime 2016141T035923.662Z :basicordinaldatetimenoms 2016141T035923Z :basicttime T035923.662Z :basicttimenoms T035923Z :basictime 035923.662Z :basictimenoms 035923Z :basicweekdate 2016W205 :basicweekdatetime 2016W205T035923.662Z :basicweekdatetimenoms 2016W205T035923Z :date 20160520 :datehour 20160520T03 :datehourminute 20160520T03:59 :datehourminutesecond 20160520T03:59:23 :datehourminutesecondfraction 20160520T03:59:23.662 :datehourminutesecondms 20160520T03:59:23.662 :datetime 20160520T03:59:23.662Z :datetimenoms 20160520T03:59:23Z :hour 03 :hourminute 03:59 :hourminutesecond 03:59:23 :hourminutesecondfraction 03:59:23.662 :hourminutesecondms 03:59:23.662 :mysql 20160520 03:59:23 :ordinaldate 2016141 :ordinaldatetime 2016141T03:59:23.662Z :ordinaldatetimenoms 2016141T03:59:23Z :rfc822 Fri, 20 May 2016 03:59:23 +0000 :ttime T03:59:23.662Z :ttimenoms T03:59:23Z :time 03:59:23.662Z :timenoms 03:59:23Z :weekdate 2016W205 :weekdatetime 2016W205T03:59:23.662Z :weekdatetimenoms 2016W205T03:59:23Z :weekyear 2016 :weekyearweek 2016W20 :weekyearweekday 2016W205 :year 2016 :yearmonth 201605 :yearmonthday 20160520 
Return to Top  
Maps  
get (get <map> <key>) 
Allows for the retrieval of a key from a map.

getin (get <map> [<key>*]) 
Allows for deep access to a map.

assoc (get <map> <<key> <value>>*) 
Allows you to add a key and a value to a map.

associn (assoc <map> <<key> <value>*) 
Allows you to add a key and a value to a map.

selectkeys (selectkeys <map> <key>*) 
Returns a map which only contains the keys specified.

removekeys (removekeys <map> <key>*) 
Removes the provided keys from the provided map.

filtervals (filtervals <map> <predicate>) 
Specifies a predicate to test all the values of a map with.

Return to Top  
Lists  
add (add <list> <value>*) 
Adds a value to the end of a list.

remove (remove <list> <value>*) 
Removes all occurrences of a value from a list.

contains? (contains <list> <value>) 
Returns true if a list contains the value specified, otherwise it is false.

Return to Top  
Control  
if (if <predicate> <true> [<false>]) 
The if command is the basic control structure, allowing for true and false (else) paths.

cond (cond <<predicate> <value>>* [:else <value>]) 
The cond command is an extension of if and allows for a more compact expression of multiple predicates.

find (find <list> <lookupkey> <value>) 
Allows for searching a list of maps for the first element that equals the provided value.

Return to Top  
Comparator Operators  
=  Returns true if x equals y, false if not. 
!=  Negation of =. 
not  Returns true if x is logical false, false if not. 
not=  Negation of =. 
>  Returns nonnil if numbers are in monotonically decreasing order, otherwise it's false. 
>=  Returns nonnil if numbers are in monotonically nonincreasing order, otherwise it's false. 
<  Returns nonnil if numbers are in monotonically increasing orde, otherwise it's false. 
<=  Returns nonnil if numbers are in monotonically nondecreasing order, otherwise it's false. 
and 
Evaluates expression one at a time, from left to right.

or 
Evaluates expression one at a time, from left to right.

Return to Top 