Conditional Paragraphs

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 it's 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 %}