Skip to content
Welcome back Continue →

Conditional Clauses in Word (Auto Add/Remove)

Published · Updated · Reviewed by Clausery editors · Automating Word templates · 4 min read

Most contracts and letters have parts that only apply sometimes: a retainer, a guarantor, a bonus, a jurisdiction clause. Here is how to make Word documents include or drop those parts automatically.

Start with an independent contractor agreement — free See the Word template

Yes/no sections#

{#has_guarantor}
GUARANTEE
{guarantor_name} guarantees the tenant's obligations.
{/has_guarantor}

Clausery asks "Has guarantor?" and removes the whole block, including its paragraphs, when the answer is no. Questions inside the block, such as the guarantor's name, are only asked when the answer is yes.

Either/or wording#

{#is_remote}This is a remote position.{/is_remote}{^is_remote}You will work from our {office} office.{/is_remote}

{^…} is the opposite of {#…}: it keeps its text when the answer is no.

Clauses based on amounts, dates or choices#

A section does not have to be a yes/no question. In the designer, change the section's question to Computed and give it a rule such as salary > 100000, fee_type == "flat" or years_between(start_date, today()) >= 5. The clause appears when the rule is true. See logic and calculations for everything the rules can do.

Avoiding blank lines#

Put the opening and closing tags each on their own line, as in the examples above. Clausery then removes those lines along with the section, so the document never has gaps where a clause used to be.

Common patterns#

  • Guarantor. A whole guarantee section that appears only when there is a guarantor, with the guarantor's details inside it.
  • Probation. A probation paragraph and review date that disappear for senior hires who do not have one.
  • Bonus or commission. An optional pay section that appears only when the answer is yes, with the rate and conditions inside.
  • Jurisdiction-specific wording. England and Wales, Scotland or Northern Ireland clauses selected by a single choice.
  • Optional services. Maintenance, training or support paragraphs that only belong in some quotes.

Keep one question behind each section. If two independent conditions control the same paragraph, combine them into one computed section instead of nesting tags, so the logic stays readable.

Test every branch#

Generate the document twice for each yes/no question: once with the section on and once with it off. Read the output around the join, not just the answer summary. Check that no stray blank line, duplicate heading or orphaned sub-clause remains, and that a section which is off does not leave its child questions in the questionnaire.

When a clause will not disappear#

  • The closing tag has a different name. Section names are case-sensitive and must match exactly.
  • The tags are in different paragraphs. Word can split a tag across runs. Retype the tag in one go, or copy it from the template instead of retyping.
  • The section is inside a table cell. Put the opening tag at the start of the first cell and the closing tag at the end of the last cell of the same row.
  • The answer is being read as text. A computed section needs a rule that returns true or false; check the rule in the designer.

Keep it maintainable#

Name sections for the question, not the paragraph: has_guarantor is clearer than section_4. Add a short note in the template's help text for whoever edits it next. When a clause changes, update the template once and every future draft inherits the change.

Try it with your own document

Download a starter template#

Questions

Can I use conditional clauses in a table row?

Yes, but the tags must be inside the same row: opening at the start of the first cell, closing at the end of the last. To repeat a row per item, use a list section rather than a yes/no section.

What is the difference between a section and a computed section?

A section is controlled by a yes/no question the client answers. A computed section is controlled by a rule you write, such as an amount, a date or a choice, and the client does not see a separate yes/no question.

Will the document leave a blank page when a section is removed?

Clausery removes the paragraphs inside the section, including the tag lines. If you see a gap, check that the opening and closing tags are each on their own line and are not inside a text box.

More on automating Word templates

Browse all guides by topic

Helpful?

Start with an independent contractor agreement, free →
Continue drafting Top