Use dynamic documents to include or exclude entire sections of content based on variable values filled in when sending a document for signing. ## Prerequisites - A DOCX or HTML template uploaded as a dynamic document - At least one recipient role configured on the template ## Steps ### Step 1: Upload a dynamic document Go to **Templates** and click **New Template**. Upload a `.docx` or `.html` file. DocuSeal automatically detects it as a dynamic document, enabling the rich text editor with variable and condition support. ### Step 2: Add variables to your document Type `[[variable_name]]` directly in the document editor to insert a variable placeholder. Use double square brackets around any name, e.g. `[[company_name]]` or `[[payment_terms]]`. These become fillable fields when sending. ![Add variables to your document](https://docuseal.supportpages.io/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTU0LCJwdXIiOiJibG9iX2lkIn19--1bb17727d7f5593d9175bbd47fad34a30a9305a3/step_1.png) ### Step 3: Wrap a section in a condition Select the text you want to conditionally show or hide. A floating toolbar appears. Click **Condition**. DocuSeal wraps the selection with `[[if:variable]]` and `[[end]]` tags. ![Wrap a section in a condition](https://docuseal.supportpages.io/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTU1LCJwdXIiOiJibG9iX2lkIn19--18777b591df96f19958868c1b8ce5b6d26a9cb2b/step_2.png) ### Step 4: Name the condition variable Replace the placeholder word `variable` in the `[[if:variable]]` tag with a descriptive name, e.g. `[[if:include_nda]]`. Everything between `[[if:include_nda]]` and `[[end]]` only appears in the final document when that variable is filled or checked. ![Name the condition variable](https://docuseal.supportpages.io/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTU2LCJwdXIiOiJibG9iX2lkIn19--85a362e86d5debc4c3ee58d35950bf4b6a29eaca/step_3.png) ### Step 5: Configure variable types in the sidebar Click the **[[ ]]** button next to the role selector to open the variables panel. Click the gear icon on any variable to set its type: **text**, **number**, **date**, **checkbox**, **radio**, or **select**. For condition variables, **checkbox** is typical. ![Configure variable types in the sidebar](https://docuseal.supportpages.io/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTU3LCJwdXIiOiJibG9iX2lkIn19--c669ce8dbb6421e5ccaaf1a13f66518ae9b37007/step_4.png) ### Step 6: Use comparison conditions (optional) For more control, use comparison operators in condition tags: - `[[if:plan == "premium"]]` — equals - `[[if:amount > 1000]]` — greater than - `[[if:region AND active]]` — multiple conditions - `[[if:!include_nda]]` — negation Combine with `[[else]]` for alternate content: `[[if:plan == "premium"]]`...`[[else]]`...`[[end]]`. ### Step 7: Save and send Click **Save**. When you click **Send**, a form appears with input fields for each variable. Fill in values or toggle checkboxes. The final document includes or excludes conditional sections based on these values. ## Tips - Variable names are auto-detected from `[[...]]` tags and appear in the sidebar automatically. - Use `[[for:items]]`...`[[end]]` to repeat a section for each item in a list variable. - Set default values on variables via the gear icon in the variables panel to pre-fill common values. - Condition variables set to **checkbox** type render as toggles in the send form, making it easy to include/exclude sections. ## Summary Wrap content between `[[if:variable]]` and `[[end]]` tags in a dynamic document to conditionally include or exclude sections. Configure each variable's type in the sidebar, then fill values when sending to control what appears in the final signed document.