Show or hide a section based on a field’s value
Make a section of the document print only when a field has a value, or only when it’s empty. The content after it moves up into its place.
Before you start · for owners and managersThe permission to edit document templates
Before you start · for owners and managers
The permission to edit document templates
- You need: The permission to edit document templates
Steps
1
Select the content, make it a section, and name it, such as “Second party”.
2
Under When does it print?, choose a rule and the field.
Only one rule per section.
3
Preview with different records. See Preview a template with a real record, or download a proof.
When a field counts as empty
Value
Counts as
No value, empty text or an empty list
Empty
The number zero
Has a value
Line items
Empty if it has no items
A lookup field
Depends on the value in the source record
Content linked to a section: an element somewhere else, such as a pinned element on another page, can be linked to a section so it’s removed with it.
Nested sections: a section inside a hidden section is hidden too.
If the field the rule depends on is deleted from the unit, the section always prints.
At a glance
Rule
The section prints when
Only when a field is filled in
The field has a value
Only when a field is empty
The field is empty. Good for a full replacement text
If something goes wrong
What you see
Why
What to do
The section always prints
The field was deleted from the unit.
Choose a field that exists.
The section is hidden and the field’s value is zero
Zero counts as having a value, so Only when a field is empty hides it.
Use the opposite rule.
You don’t know why a section disappeared
—
Preview with a record to see each section and why it’s hidden. See Preview a template with a real record, or download a proof.
A real example
Shield Security Co.
The situation
Some contracts have a guarantor and some don’t, so empty boxes showed.
What they did
- A “Guarantor details” section prints when the “Guarantor name” field has a value.
- A “There’s no guarantor for this contract” section prints when it’s empty.
The result
Each contract prints only what applies to it, with no empty boxes.
A made-up company, to show the idea. The numbers are rounded.
Good to know
One rule per section. If both rules are set, Only when a field is filled in applies.
Did this guide solve it?
If not, we’ll ask what was missing.