The ASK instruction tells HotDocs to display in the interview the dialog or variable you specify.
The ASK instruction is only available when you are creating a computation or from the Field Editor in a template..
There are three main ways you might use the ASK instruction:
If the variable is linked to a dialog, HotDocs displays the entire dialog.
Instruction name | Model | After you drag and drop the model into the script tab: |
ASK | ASK ⟦VAR,DIALOG⟧ | Replace ⟦VAR,DIALOG⟧ with any variable or dialog. |
A template author is creating a medical insurance form. They need to ask the template user for the name of their insurance company only if more than a year has passed since the template user last filled out the form. The interview already has the template user's information about any previous claims, so they just need to have HotDocs use that information to decide whether or not to ask the text variable: InsuranceCompanyName.
They create a computation and in the Script tab they type the following:
IF MONTHS FROM( LastClaimDate, TODAY ) >= 13
ASK InsuranceCompanyName
END IF
The first line of the script instructs HotDocs to look at the answer to the LastClaimDate date variable and see if that date is 13 or more months from today's date. The IF instruction opens the conditional region and uses the MONTHS FROM function to find the number of months between the two days and compare it to the number 13. If 13 or more months have passed, the ASK instruction asks InsuranceCompanyName in the interview. If less than 13 months have passed, nothing new is added to the interview. The END IF instruction closes the conditional region.
After you download the example template, you can import the template to any workspace to see this example code in action.