Expression Model: ANSWERED(VAR) and ANSWERED(DIALOG)

This tip covered the expression models: ANSWERED(VAR) and ANSWERED(DIALOG).  Most often these are used in templates, but they are also used in computations to test whether a variable or a dialog has been answered.  Hotdocs scripts will be interrupted if the value of any required variable is not known.  For this reason, the use of the”answered” function gives a value where no value is known.

What are the elements?

  • ANSWERED: The function
  • VAR: Any variable.  All variables will have an “answered” or “unanswered” status.  Note, that you can force an answered status on a variable under two conditions: (1) if the variable has a “default” and the dialog on which the variable appears has been asked, or (2) the variable is a True/False variable on a dialog with an Ask All setting and that dialog has been asked.
  • DIALOG: Any dialog.  This tests whether the dialog has been “asked” in an interview.

Usage of ANSWERED expression:

  • Usage is disparaged by the software developers as “unnecessary”.  A properly designed template should have sufficient nesting of logic such that you need not test whether a particular variable has been answered.  This is particularly true when you use variable in IF EXPRESSIONS.

     

  • It is also disparaged because the way HotDocs does (or rather does NOT) clear data.  If a variable is “hidden” based on a dialog scripting rule, the hidden variable still retains its value.  For this reason, you should not depend on the answered status of a variable to determine whether a phrase should be included if there are parent conditions not expressed in the template.

     

  • Usage is recommended if you want something special to happen, other than the ordinary, if a variable has not been answered.  While you can use “tokens” in the advanced properties of a variable, you may want to put the rules into a computation.


CLIENT Address 1 TE
IF ANSWERED(CLIENT Address 2 TE)
RESULT + “
“ + CLIENT Address 2 TE
END IF