Adding basic conditional statements to a DOCX template

In addition to adding data fields to a DOCX template, you can also add simple control flow through if statements by embedding a tag into your document in the following format:

{% if [boolean condition] %}  
   text and/or field  
{% endif %}

For example, if you wanted to include the names.last field only if there was an object called names, you would embed the following tag:

{% if names %}
   Last Name: {{names.last}} 
{% endif %}

To see conditional statements in action, check out how to build a full-featured DOCX template.