Skip to main content

Block Tags and Empty Fields

Block tags automatically show or hide content depending on whether a form field is filled in or empty.

⚠️ Important

Before using block tags, we recommend reading the tutorial What are Block Tags? to understand their role and how to use them.

The examples shown here use generic identifiers. When applying this in practice, replace them with the actual identifiers of your own fields.

1. Comparison operators

Depending on your needs, you can use comparison operators as a suffix in block tags.

General syntax:

##_block:identifier-operator:value## 
...content...
##_block:identifier-operator:value##

List of available operators:

Operator

Meaning

-eq:value

Equal to

-ne:value

Not equal to

-lt:value

Strictly less than

-le:value

Less than or equal to

-gt:value

Strictly greater than

-ge:value

Greater than or equal to

2. Example form

Let's take a form with the following fields:

  • Client: drop-down list to select a client's name → ##client##.
    The list is coded as follows:

    • A:Client A

    • B:Client B

  • New client: free-text field for a client not present in the list → ##new_client##.

3. Display a section of the document related to a field if it is filled in

In the export, you want to display:

Client: ##client##

But if the Client field is not filled in, the line should disappear instead of appearing empty.

Use the following block tag:

##_block:client##

Client: ##client##

##_block:client##

4. Show/hide a field depending on whether another field is filled in or not

Use case

You fill in either Client or New client, but never both.

Without a condition, your export would always display an empty line :

Client: Client A

New client:

or

Client:

New client: Client C

The goal is therefore to hide the lines corresponding to empty fields. There are two options: using the equals operator (-eq:) or the not-equals operator (-ne:).

4.1 If the field is empty

Use the equals operator (-eq:)

Syntax

Result

##_block:client-eq:##
New client: #new_client##
##_block:client-eq:##

If Client = empty → display New client

##_block:new_client-eq:##
Client: ##client##
##_block:new_client-eq:##

If New client = empty → display Client

4.2 If the field is filled in

Use the not-equals operator (-ne:)

Syntax

Result

##_block:client-ne:##
Client: ##client##
##_block:client-ne:##

If Client ≠ empty → display Client

##_block:new_client-ne:##
New client: ##new_client##
##_block:new_client-ne:##

If New client ≠ empty → display New client

5. Show/hide specific content depending on whether a field is filled in

You can also make the display of a text, table, or image conditional.

For example, if the New client field is filled in, display the message: "This is a new client."

There are two options: using the equals operator (-eq:) or the not-equals operator (-ne:).

5.1 If the field is empty

Use the equals operator (-eq:)

Syntax

Result

##_block:client-eq:##
This is a new client
##_block:client-eq:##

If Client = empty → display the sentence

5.2 If the field is filled in

Use the not-equals operator (-ne:)

Syntax

Result

##_block:new_client-ne:##
This is a new client
##_block:new_client-ne:##

If New client ≠ empty → display the sentence

💡 Tip

To make your export template easier to read and edit, you can highlight the block tags. This highlighting won't appear in the final export, but it will help you quickly spot them if you need to rework the template.

Did this answer your question?