Documate is now Gavel! Read more about why we’re excited about this rebrand.

Conditional Paragraphs

You can make the appearance of certain paragraphs (or even whole pages) dependent on the user’s answer to a question.  To do this using the no-code Word add-in:

  1. Open the Word add-in and select the workflow you'd like to use.
  2. Highlight the phrase you'd like to make conditional.
  3. Click "Show paragraph when..."
  4. Choose the variable and value you want to base your logic on.
  5. To add complex logic, click "Add Condition" and repeat step 4.
  6. Click "Insert.

If you have a conditional paragraph (as opposed to a conditional word or sentence within a permanent paragraph), your if/endif statements will include a %p as shown below, so that the system knows to remove the entire paragraph and spaces before and after it.

Standard Conditional Paragraph Syntax

{%p if VariableName %}

Conditional paragraph here.

{%p endif %}

Conditional Numbered Paragraphs or Table Rows

This formatting can be used with numbered paragraphs or tables, too, by entering your “if” and “endif” phrases on separate lines before and after the numbered paragraph (or the desired table row), like this:

  1. {%p if VariableName %}
  2. Paragraph text here.
  3. {%p endif %}

Everything above stays constant except the variable name if your question is a Yes/No.  For  multiple choice/checkbox questions, you will use the X =='Y' and variable['choice'] syntax shown in the preceding Conditional Phrases section.

Using "Else" Statements

The best way to set up alternate conditional statements is using the Word add-in, where you will set separate conditions (each with its own if and endif for each condition). However, you are also able to use else statements to make the conditions shorter by placing {% else %} in between two statements.

For example, a statement like this:

{% if variable == 'Option 1' %}Text here.{% endif %}{% if variable == 'Option 2' %}Text 2 here.{% endif %}

Can instead be written like this, replacing the endif and the second if with else:

{% if variable == 'Option 1' %}Text here.{% else %}Text 2 here.{% endif %}

Similarly, you can add multiple alternate options by using elif (which means "else if"). For example:

{% if variable == 'Option 1' %}Text here.{% elif variable == 'Option 2' %}Text 2 here.{% elif variable == 'Option 3' %}Text 3 Here{% endif %}