HotDocs to Knackly Functions

Most, if not all functions available in HotDocs are available in Knackly.

HotDocs Function Knackly Equivalent
TEXT + TEXT

FIRST( TEXT, NUM ) text.first(num) (extended String prototype)
INTEGER( TEXT ) text.toInt() (extended String prototype)
LAST( TEXT, NUM ) text.last(num) (extended String prototype)
LENGTH( TEXT ) text.length
MID( TEXT, NUM, NUM ) text.substring(num, num)
POSITION( TEXT, TEXT ) (case insensitive) text.indexOf(text) (case sensitive)
REPLACE( TEXT, TEXT, TEXT, NUM ) (case insensitive) text.replaceAll(text, text) (extended String prototype)
SPACE( TEXT, TEXT ) 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()



NUM + NUM num + num
NUM - NUM num - num
NUM * NUM num * num
NUM / NUM num / num
ABSOLUTE VALUE( NUM ) math.abs(num)
CEILING( NUM ) math.ceil(num)
EXPONENTIAL( NUM ) math.exp(num)
FLOOR( NUM ) math.floor(num)
LOGARITHM( NUM ) math.log10(num)
MAX( NUM, NUM ) math.max(num, num, …)
MIN( NUM, NUM ) math.min(num, num, …)
NATURAL LOGARITHM( NUM ) math.log(num)
POWER( NUM, NUM ) math.pow(num, num)
REMAINDER( NUM, NUM ) num % num
ROUND( NUM, NUM ) math.round(num)
SQUARE ROOT( NUM ) math.sqrt(num)
TRUNCATE( NUM, NUM ) math.trunc(num)
ZERO( NUM_VAR ) 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()



TODAY 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 ) date.new(year, month, day)
DAY OF( DATE ) date.dayOf(date)
DAY OF WEEK( DATE ) date.dayOfWeek(date)
DAYS FROM( START, FINISH )
date.daysBetween(date, date)
MONTH OF( DATE ) date.monthOf(date)
MONTHS FROM( DATE, DATE )
date.monthsBetween(date, date)
YEAR OF( DATE ) date.yearOf(date)
YEARS FROM( DATE, DATE )
date.yearsBetween(date, date)



NOT TRUE_FALSE !true_false
TRUE_FALSE AND TRUE_FALSE true_false && true_false
TRUE_FALSE OR TRUE_FALSE true_false || true_false
TRUE_FALSE = TRUE_FALSE true_false == true_false
TRUE_FALSE != TRUE_FALSE true_false != true_false
TEXT = TEXT (case insensitive) text == text (case sensitive)
TEXT != TEXT (case insensitive) text != text (case sensitive)
TEXT CONTAINS TEXT (case insensitive) text.includes(text) (case sensitive)
TEXT ENDS WITH TEXT (case insensitive) text.endsWith(text) (case sensitive)
TEXT STARTS WITH TEXT (case insensitive) text.startsWith(text) (case sensitive)
TEXT < TEXT (case insensitive) text < text (case sensitive)
TEXT <= TEXT (case insensitive) text <= text (case sensitive)
TEXT > TEXT (case insensitive) text > text (case sensitive)
TEXT >= TEXT (case insensitive) text >= text (case sensitive)
MULT_CHOICE = TEXT (case insensitive) array.includes(text) (case sensitive)
MULT_CHOICE != TEXT (case insensitive) !array.includes(text) (case sensitive)



NUM = NUM num == num
NUM != NUM num != num
NUM < NUM num < num
NUM <= NUM num <= num
NUM > NUM num > num
NUM >= NUM num >= 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')
ANSWERED( DIALOG )

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



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


SUM( NUM_VAR )

SELECTION( MULT_CHOICE_VAR, NUM ) array[num]
OTHER( MULT_CHOICE_VAR )
n/a
UNION( MULT_CHOICE, MULT_CHOICE ) array.concat(array)
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us