SET Instruction

The SET instruction enables you to specify an answer value for a variable.

The SET and DEFAULT instructions both assign answers to variables but, while the DEFAULT instruction only sets the value of the variable the first time HotDocs processes the instruction and only if the variable is unanswered, the SET instruction sets the value of the variable every time HotDocs processes the instruction is processed (even if the variable is already answered).

You can use the SET instruction to transfer values from one variable to another or to give a value to a function in a script, like ERRORTEXT.

Instruction name Model After you drag and drop the model into the script tab:
SET SET ⟦VAR⟧ TO ⟦EXPRESSION⟧ Replace ⟦VAR⟧ with the variable you want to set an answer for.
Replace ⟦EXPRESSION⟧ with a literal value, variable, or expression that you want HotDocs to use as the answer for this variable.

Example

With the SET instruction, you can transfer names and other values from one variable to another.

For example, if the plaintiff is the same as the client, you can use a SET instruction to automatically enter the plaintiff’s name as the client’s, saving the user from typing the name a second time:

IF Is Plaintiff Also Client

SET Client Name TO Plaintiff Name

END IF

Download

After you download the example template, you can import the template to any workspace to see this example code in action.