ANSWERED( VAR )

Placeholder Tooltip Replace With
VAR v: Variable A variable

Returns a True/False value

You can use the ANSWERED expression to determine whether a HotDocs variable has been assigned a value. If so, the expression receives the value of true.

If you are testing whether a user has ANSWERED a variable, you must make sure the variable is presented to the user using a custom dialog. Using the ANSWERED( VAR ) expression alone will not automatically force HotDocs to display the variable for the user.

For example, you may place a variable for the second line of an address (Client Address 2) in a custom dialog; however, not all users will provide information for that variable. In the template text, you can surround Client Address 2 with an IF expression that merges that variable into the document—only if the user answers it:

«Client Name»

«Client Address 1»

«IF ANSWERED( Client Address 2 )»

«Client Address 2»

«END IF»

«Client City», «Client State» «Client ZIP»

In this script, the ANSWERED expression is used with an IF expression to insert or remove Client Address 2, based on whether the user has provided that information. (Without it, the default unanswered text, ***Client Address 2***, would be inserted in the assembled document.)

Even if a user chooses not to answer a variable that has been tested using the ANSWERED expression, HotDocs will still warn that it is unanswered. If you don't want a warning to appear, clear Warn when unanswered at the Advanced tab of the Variable Editor. (Control How HotDocs Processes a Variable.)