# Conditional rows, columns, sections & blocks

## Conditional table rows <a href="#conditional_table_rows" id="conditional_table_rows"></a>

You can make table rows conditional by preceding a condition with *ROW* anywhere in the row. For example:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713262569128/image.png" alt=""><figcaption></figcaption></figure>

When *@condition1* is set to "no", the first row gets hidden.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713262632547/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The condition can be as complex as you like, invoking special-functions and combinations with AND/OR/NOT if necessary. But for the sake of simplicity, we'll stick to simple conditions on this web page.
{% endhint %}

It does not matter where the ROW condition is located. So the following would work equally well, as opposed to having the ROW condition in the beginning of the first cell of the row.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713262785150/image.png" alt="" width="375"><figcaption></figcaption></figure>

Note that you should differentiate between a *row condition* and a *condition inside a row*. For example, the second row in the first screenshot above contains a @condition2 within the row, not preceded by *ROW*. Such condition works in the normal way, disable the paragraph within the cell, but not removing the row. For example:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713262722581/image.png" alt="" width="375"><figcaption></figcaption></figure>

## Conditional table columns <a href="#conditional_table_columns" id="conditional_table_columns"></a>

Making table columns conditional is similar to making rows condition: you prefix *COLUMN* or *COL* in some condition within the cell. For example:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713263962634/image.png" alt=""><figcaption></figcaption></figure>

When *condition1* is set to "no", the column will disappear:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713264002449/image.png" alt=""><figcaption></figcaption></figure>

Similar to the rows, it does not matter in which cell you put the column-condition, so the following will work equally well:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713264154765/image.png" alt="" width="375"><figcaption></figcaption></figure>

Note that strange things may happen when your table contains merged/split cells. This is currently not supported.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713264036251/image.png" alt=""><figcaption></figcaption></figure>

## Conditional sections <a href="#conditional_sections" id="conditional_sections"></a>

MS Word documents are subdivided into "sections", divided by *section breaks*. Each section can have its own page settings, numbering, and so on.

In practice, in legal documents, new sections are often created to host annexes, schedules and so on.

It is possible to make an entire section optional by prefixing a condition in one of the section's paragraphs with *SECTION,* e.g.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713264414790/image.png" alt=""><figcaption></figcaption></figure>

## Conditional blocks <a href="#conditional_blocks" id="conditional_blocks"></a>

You can also make multiple document elements conditional by wrapping those elements within <<< and >>>.  For example, in the screenshot below, you can see that a table, some "Smart Art" and a mathematical formula are wrapped inside of a conditional block.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713264724357/image.png" alt=""><figcaption></figcaption></figure>

Each conditional block must have an identifier, right after the <<< and >>> (in the screenshot below, the identifier is *optional-stuff*). The identifier must not contain a space, but can contain hyphens, numbers, etc.&#x20;

{% hint style="danger" %}
Importantly, the <<< and >>> and their respective identifiers and conditions should be included as a separate line, with no text before or after them.&#x20;
{% endhint %}

The identifier should be included in both the start (after the <<<) and the end (after the >>>). The idea is that you can nest identifiers, e.g. to have an optional table inside of an optional outer block. For example, in the screenshot below, you can see that the Smart Art is wrapped in an inner conditional block, which does not show up because that inner conditional block's *@condition2* is set to No.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/a0irling87/1713265010409/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Important: conditional blocks cannot cross MS Word sections, i.e. each conditional block will automatically end at the end of the MS Word section.
{% endhint %}

## Conditional text boxes <a href="#conditional_text_boxes" id="conditional_text_boxes"></a>

It is possible to make Word "text boxes" (which float above the page and can contain content of their own) conditional.

Navigate to the "Insert" tab in MS Word and select the "Text Box" option to draw a text box in which you will place your table.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686129216859/image.png" alt="" width="375"><figcaption></figcaption></figure>

Write your condition, then insert the text box and include your table inside of it. When you click the table, you should see an anchor appear next to your condition. This is important, as it decides the conditional logic that is applied to the text box/table.

By way of example, with a text box containing a table:

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686129465141/image.png" alt="" width="375"><figcaption></figcaption></figure>

Then, right-click the text box and select "More Layout Options" >> "Text Wrapping" and activate the "Top and Bottom" wrapping style.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686130167715/image.png" alt="" width="375"><figcaption></figcaption></figure>

Update/Upload the document and set the question up to show or hide the frame as necessary.

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686130988618/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686131019100/image.png" alt="" width="375"><figcaption></figcaption></figure>

You may also consider hiding the text box itself, by right-clicking it, selecting "Format Shape" and under "Shape Options" >> "Line" selecting the option "No line".

<figure><img src="https://files.helpdocs.io/f86qgdbm02/articles/k7ap2bfkbh/1686130898717/image.png" alt="" width="375"><figcaption></figcaption></figure>

## Conditional page breaks <a href="#conditional_page_breaks" id="conditional_page_breaks"></a>

Page breaks can also be conditional. As, technically speaking, page breaks are actual treated as *characters* inside of a paragraph, you can simply make a paragraph conditional by starting it with a condition and a colon.

Note that you will want to probably show the "Formatting marks" (the reverse P in the Word toolbar), otherwise the page break will not be visible.

<figure><img src="/files/aC09JoYLM06d2vRcgtvE" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.clausebuddy.com/smart-templates/how/in-depth/smart-templates-in-depth/conditional-rows-columns-sections-and-blocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
