HotDocs Tips & Tricks

Tips, tricks and solutions with the HotDocs document assembly platform
Sunday, October 28, 2007

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.

Article Content

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.

Extended Thoughts:


CLIENT Address 1 TE
IF ANSWERED(CLIENT Address 2 TE)
RESULT + “
“ + CLIENT Address 2 TE
END IF
Posted by Seth
Page 1 of 1 pages

Statistics

Page Views: 5895
Page rendered in 0.4154 seconds
34 queries executed
Total Entries: 82
Most Recent Entry: 07/16/2008 11:19 am
Total Members: 5
Total Logged in members: 0
Total guests: 6
Most Recent Visitor on: 08/28/2008 01:43 pm
Most visitors ever: 87 on 11/07/2006 02:22 pm