---
title: "Conditionally add/remove content"
description: "Add or remove content conditionally in Docmosis templates so generated documents display only relevant sections by evaluating true/false expressions"
canonical_url: "https://resources.docmosis.com/template-tutorials/conditional-sections"
last_reviewed: 2026-06-08
---
# Conditionally add/remove content
Conditional sections are similar to an "IF" statement.
They are created using the \<\\> is like saying:
IF ***sampleValue1\= "true"*** THEN
***display all text up to the closing field \<\\>***
The data should contain a true/false boolean value. In JSON this could be something like:
- "sampleValue1":"true"
- "sampleValue1":true
TIP: If a\<\\>
This line only appears in the final document if **sampleValue1** is set to **“true”**.
\<\\>
The numbering of items in the list adjusts automatically:
1. RED
\<\\>
2. YELLOW
\<\\>
3. GREEN
4. BLUE
Any expression that returns a true/false value can be used when creating conditional sections
\<\\>
This line only appears in the final document if **sampleValue3** is equal to the number **7**.
\<\\>
\<\\>
This line only appears in the final document if **sampleValue4** is equal to the number **frog**.
\<\\>
\<\\>
This line only appears in the final document if **sampleValue1 or sampleValue2** is **True**.
\<\\>
```