Conditional Sections

Category : Technical Examples

Conditional Sections allow any content in the template to be included or removed from the final document.

When used with numbered lists - the list numbering adjusts automatically.

Data Files

Output Files

All Files as a ZIP

This example shows

1) Conditional Sections

    These start with <<cs_ and end with <<es_ (End Section).

    These are like IF statements. <<cs_sampleValue1>> is like saying:

    IF sampleValue1= "true" THEN

      display all text up to <<es_sampleValue1>>

    In your data you would have: "sampleValue1":"true" (JSON example).

    If <<cs_ or <<es_ is on a line by itself - the line is removed in the final document.


2) List Numbering adjusts automatically

    The Numbered List has the second item surrounded by: <<cs_ and <<es_.

    The data contains: "sampleValue2":"false"  (JSON example).

    In the final document item 2 does not appear.

    The numbering of the remaining items in the list adjusts automatically.

TRY: changing "sampleValue2" to "true".


3) Regular Expressions inside { braces }

    The expression {sampleValue3=7} will be evaluated.

    If "true" then all following text up to the next <<es_ will appear in the final document.

    In your data you would have: "sampleValue3":"7"  (JSON example).


LEARN MORE: Download our Docmosis Quick Reference [PDF].