HotDocs Author WorkflowCreate a template Add placeholders Group variables in dialogs Upload a template Create a script

LIST CONTAINS EXPRESSION Operator

The LIST CONTAINS EXPRESSION operator returns a value of true if the list value CONTAINS a record value contained in the expression you provide.

You can use this operator (which returns a true/false value) in your conditional statements to determine whether a list (most commonly the answer to a Multi Select variable) contains a specific item (i.e. one of the options).

Operator Model After you drag and drop the model into the script tab: Expression returns:
CONTAINS ⟦LIST⟧ CONTAINS ⟦EXPRESSION⟧ Replace the first ⟦LIST⟧ placeholder with the list value that you want check, such as an answer to a Multi Select or Table variable. Replace the ⟦EXPRESSION⟧ placeholder with an expression that contains the value you are checking for (the value type must match the items in the list). A true/false value.

Example

You could use CONTAINS in an interview script to decide whether to ask a certain question, for example:

IF Document Types CONTAINS "Trust"
    ASK Trust Info
END IF

You could also use the NOT Operator with CONTAINS to determine whether or not to ask a certain question, for example:

IF NOT (Document Types CONTAINS "Will")
    ASK Retirement Planning
END IF

You could also use CONTAINS in a template to determine whether or not to include a block of text, for example:

[IF Document Types CONTAINS "Will"]

LAST WILL AND TESTAMENT OF [Client Name]

[END IF]