Dynamic content
Remove sections without data
Merge the report and observe how complete template regions disappear when their corresponding JSON arrays are empty or missing.
Understand the current template
Explore its merge fields, repeating blocks, and nested structure in an interactive template map.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Let data control document structure
Conditional sections are regular merge blocks whose content is retained only when matching records exist. They can contain complete clauses, tables, images, or any other document content.
RemoveEmptyBlocks removes both the block markers and their enclosed content when no data is available, avoiding blank placeholders in the final document.
API used
MailMerge.RemoveEmptyBlocks
How it works
The controller enables RemoveEmptyBlocks before merging the JSON. MailMerge evaluates each named block against the data hierarchy and removes unmatched regions during expansion.