HotDocs FunctionNative JavaScript equivalentKnackly Equivalent




TEXT + TEXTtext + text

FIRST( TEXT, NUM )text.substring(0, num)text.first(num)(extended String prototype)
INTEGER( TEXT )Number.parseInt(text)text.toInt()(extended String prototype)
LAST( TEXT, NUM )text.slice(-num)text.last(num)(extended String prototype)
LENGTH( TEXT )text.lengthtext.length
MID( TEXT, NUM, NUM )text.substring(num, num)text.substring(num, num)
POSITION( TEXT, TEXT ) (case insensitive)text.indexOf(text) (case sensitive)text.indexOf(text) (case sensitive)
REPLACE( TEXT, TEXT, TEXT, NUM ) (case insensitive)text.replace(text, text) (case sensitive)text.replaceAll(text, text)(extended String prototype)
SPACE( TEXT, TEXT )text ? text + " " : "" (ternary operator)text ? text + " " : "" (ternary operator)
STRIP( TEXT, TEXT, TRUE_FALSE, TRUE_FALSE )
text.strip(text, true_false, true_false)(extended String prototype)
TRIM( TEXT )text.trim()text.trim()




NUM + NUMnum + numnum + num
NUM - NUMnum - numnum - num
NUM * NUMnum * numnum * num
NUM / NUMnum / numnum / num
ABSOLUTE VALUE( NUM )Math.abs(num)math.abs(num)
CEILING( NUM )Math.ceil(num)math.ceil(num)
EXPONENTIAL( NUM )Math.exp(num)math.exp(num)
FLOOR( NUM )Math.floor(num)math.floor(num)
LOGARITHM( NUM )Math.log10(num)math.log10(num)
MAX( NUM, NUM )Math.max(num, num, …)math.max(num, num, …)
MIN( NUM, NUM )Math.min(num, num, …)math.min(num, num, …)
NATURAL LOGARITHM( NUM )Math.log(num)math.log(num)
POWER( NUM, NUM )Math.pow(num, num)math.pow(num, num)
REMAINDER( NUM, NUM )num % numnum % num
ROUND( NUM, NUM )Math.round(num)math.round(num)
SQUARE ROOT( NUM )Math.sqrt(num)math.sqrt(num)
TRUNCATE( NUM, NUM )Math.trunc(num)math.trunc(num)
ZERO( NUM_VAR )x ? x : 0 (conditional/ternary operator)x ? x : 0 (conditional/ternary operator)




FUTURE VALUE (RATE, TERM, PAYMENT, PRESENT VALUE, TYPE)
finance.FV()
PAYMENT (RATE, TERM, PRESENT VALUE, FUTURE VALUE, TYPE)
finance.PMT()
PRESENT VALUE (RATE, TERM, PAYMENT, FUTURE VALUE, TYPE)
finance.PV()
RATE (TERM, PAYMENT, PRESENT VALUE, FUTURE VALUE, TYPE)
finance.RATE()
TERM (RATE, PAYMENT, PRESENT VALUE, FUTURE VALUE, TYPE)
finance.NPER()




TODAYDate.now()date.today()
DATE + NUM DAYS
date.addDays(date, num)
DATE + NUM MONTHS
date.addMonths(date, num)
DATE + NUM YEARS
date.addYears(date, num)
DATE - NUM DAYS
date.subDays(date, num)
DATE - NUM MONTHS
date.subMonths(date, num)
DATE - NUM YEARS
date.subYears(date, num)
AGE( DATE )
date.age(date)
DATE OF( DAY, MONTH, YEAR )new Date(year, month-1, day)date.new(year, month, day)
DAY OF( DATE )date.getDate()date.dayOf(date)
DAY OF WEEK( DATE )date.getDay()date.dayOfWeek(date)
DAYS FROM( START, FINISH )
date.daysBetween(date, date)
MONTH OF( DATE )date.getMonth()date.monthOf(date)
MONTHS FROM( DATE, DATE )
date.monthsBetween(date, date)
YEAR OF( DATE )date.getYear()date.yearOf(date)
YEARS FROM( DATE, DATE )
date.yearsBetween(date, date)




NOT TRUE_FALSE!true_false!true_false
TRUE_FALSE AND TRUE_FALSEtrue_false && true_falsetrue_false && true_false
TRUE_FALSE OR TRUE_FALSEtrue_false || true_falsetrue_false || true_false
TRUE_FALSE = TRUE_FALSEtrue_false == true_falsetrue_false == true_false
TRUE_FALSE != TRUE_FALSEtrue_false != true_falsetrue_false != true_false
TEXT = TEXT (case insensitive)text == text (case sensitive)text == text (case sensitive)
TEXT != TEXT  (case insensitive)text != text (case sensitive)text != text (case sensitive)
TEXT CONTAINS TEXT (case insensitive)text.includes(text) (case sensitive)text.includes(text) (case sensitive)
TEXT ENDS WITH TEXT (case insensitive)text.endsWith(text) (case sensitive)text.endsWith(text) (case sensitive)
TEXT STARTS WITH TEXT (case insensitive)text.startsWith(text) (case sensitive)text.startsWith(text) (case sensitive)
TEXT < TEXT (case insensitive)text < text (case sensitive)text < text (case sensitive)
TEXT <= TEXT (case insensitive)text <= text (case sensitive)text <= text (case sensitive)
TEXT > TEXT (case insensitive)text > text (case sensitive)text > text (case sensitive)
TEXT >= TEXT (case insensitive)text >= text (case sensitive)text >= text (case sensitive)
MULT_CHOICE = TEXT (case insensitive)array.includes(text) (case sensitive)array.includes(text) (case sensitive)
MULT_CHOICE != TEXT (case insensitive)!array.includes(text) (case sensitive)!array.includes(text) (case sensitive)
NUM = NUMnum == numnum == num
NUM != NUMnum != numnum != num
NUM < NUMnum < numnum < num
NUM <= NUMnum <= numnum <= num
NUM > NUMnum > numnum > num
NUM >= NUMnum >= numnum >= num
DATE = DATE
date.isEqualTo( date )(extended Date prototype)
DATE != DATE
date.isNotEqualTo( date )(extended Date prototype)
DATE < DATE
date.isBefore( date )(extended Date prototype)
DATE <= DATE
date.isNotAfter( date )(extended Date prototype)
DATE > DATE
date.isAfter( date )(extended Date prototype)
DATE >= DATE
date.isNotBefore( date )(extended Date prototype)




ANSWERED( VAR )x (check the var's 'truthiness')x (check the var's 'truthiness')
ANSWERED( DIALOG )


FORMAT( VALUE, "EXAMPLE" )
see "filters" document
UNANSWEREDnullnull
VALUE( VAR, EXPRESSION )x ? x : expressionx ? x : expression




COUNT( DIALOG )array.lengtharray.length
COUNT( MULT_CHOICE_VAR )array.lengtharray.length
COUNTER
_index, _index0note also _parent, which HotDocs did not have
SUM( COMPUTATION_VAR )


SUM( NUM_VAR )


SELECTION( MULT_CHOICE_VAR, NUM )array[num]array[num]
OTHER( MULT_CHOICE_VAR )
n/a
UNION( MULT_CHOICE, MULT_CHOICE )array.concat(array)array.concat(array)