Skip to main content

What are Block Tags?

Show or hide content in your Word exports or emails using Block Tags.

⚠️ Important

Before using Block Tags, we recommend reading the tutorial Tags. It will help you understand their role, how to create them, and where to find them.

In this tutorial, examples use generic identifiers. When putting this into practice, remember to replace them with the identifiers from your own form.

1. What are Block Tags used for?

Block Tags allow you to automatically show or hide a section of your export, based on what the user entered in the form. They can conditionally display elements such as text, tables, photos, or other tags.

In particular, they allow you to:

  • Hide a section if the user leaves a field empty.

  • Display content based on the value selected in a list (color, symbol, etc.).

  • Display content if a checkbox is checked.

  • Show or hide text depending on whether a field is empty or filled.

  • Conditionally display a multiple photo field.

  • Adapt the display via a Custom User Field.

  • Conditionally display a table.

Before you begin, it is therefore important to clearly identify what you want to achieve, and from which type of field.

2. Creating and positioning Block Tags

A Block Tag is built from the tag of the field that will control the display of the content.

2.1 Creating a simple Block Tag

A simple Block Tag is used in the following cases:

  • To hide a section of the document when the related field is empty.

  • To display a section of the document if a checkbox is checked.

Simply add _block: after the first two # characters of the tag for the relevant field.

For example, if you want to hide content when the Photo field is not filled in:

  • The Photo field tag is ##photo##.

  • Add _block: after the first two #.

The Block Tag syntax is therefore ##_block:photo##.

2.2 Creating a Block Tag with a suffix

It is sometimes necessary to add a suffix to a Block Tag. This can be a comparison operator or a list/choice code.

Here are the cases:

  • To display a section of the document based on the item selected in a List or Choice field.

  • To display a section of the document if a checkbox is not checked.

  • To display specific content if a field is empty.

  • To display content when a field is filled in.

  • To display content based on the presence or absence of photos in a multiple field.

  • To display content based on the presence or absence of a Custom User Field.

As with the simple Block Tag, add _block: after the first two # of the relevant field tag. Then complete it with -suffix between the tag identifier and the last two #.

For example, if you want to display content when the item selected in the list corresponds to code 2:

  • The List field tag is ##liste##.

  • Add _block: after the first two #.

  • Add -2 between the identifier and the last two #.

The Block Tag syntax is therefore ##_block:liste-2##.

⚠️ Important

For easier writing of Block Tags, it is necessary to encode the items in List and Choice fields.

2.3 Where and how to place Block Tags?

Block Tags always work in pairs to wrap the content to be shown/hidden and must be positioned as follows:

Block Tag

Section of the document to display (text, table, image, or tag)

Block Tag

3. Best practices

For Block Tags to work correctly, the following rules must be followed:

Rule

Explanation

Syntax

##_block:identifier## or ##_block:identifier-suffix##

Encoding

List and Choice field items must be encoded

Always in pairs

One Block Tag opens and the other closes the conditional area. Both tags must be identical: ##_block:identifier## / content / ##_block:identifier##

Dedicated line

A Block Tag must be alone on its line

Location

Usable only in a Word template or an email scenario

Fields

Compatible with all field types

Name

No accents, no uppercase letters, no spaces

Table

Both block tags must both be inside the table or both outside it. If the blocks come from a field within a table, they must also be in a table.

Page break / Section break

Place them between or outside Block Tags, but not on the same line

Header / Footer

Not allowed

No Shift+Enter

Normal paragraph only, no line break

Nested tags

Possible, but in strict order: first opened = last closed: ##_block:identifier1## / ##_block:identifier2## / content / ##_block:identifier2## / ##_block:identifier1##

⚠️ Important

Stacking Block Tags is not allowed when they use the in or nin operators.

4. Comparison operators

You can condition the display based on a numeric or alphabetical value using operators:

Operator

Meaning

Syntax

-eq:

Equal to

##_block:field_identifier-eq:3##

Content to display if value = 3 ##_block:field_identifier-eq:3##

-ne:

Not equal to

##_block:field_identifier-ne:3##

Content to display if value ≠ 3 ##_block:field_identifier-ne:3##

-lt:

Strictly less than

##_block:field_identifier-lt:3##

Content to display if value < 3 ##_block:field_identifier-lt:3##

-le:

Less than or equal to

##_block:field_identifier-le:3##

Content to display if value ≤ 3 ##_block:field_identifier-le:3##

-gt:

Strictly greater than

##_block:field_identifier-gt:3##

Content to display if value > 3 ##_block:field_identifier-gt:3##

-ge:

Greater than or equal to

##_block:field_identifier-ge:3##

Content to display if value ≥ 3 ##_block:field_identifier-ge:3##

5. Summary

Context / Use case

Allowed

Not allowed

Custom Word export

Email scenario

Custom Excel export

Header / Footer

New paragraph (Enter)

Line break (Shift + Enter)

2 block tags inside a table

2 block tags outside a table

1 inside a table and 1 outside

💡 Tip

To make your export template easier to read and edit, you can highlight Block Tags. This highlighting will not appear in the final export, but it will help you locate them quickly if you need to rework the template.

Did this answer your question?