Avoid empty areas due to parameter replacement
If a Visforms placeholder is replaced with an empty field value or a 0, empty or unsightly spaces can appear in the document. A special parameter option combined with marking the freely selectable area to be deleted solves this problem.
Note: This feature is part of the Visforms Subscription and is not included in the free Visforms version.
Example
Here is an example from the form configuration.
Form result text without avoidance
A form result text is configured as an HTML template with parameter replacement.
- Form configuration » Tab: Result
Parameter Success text
p>The result text of the form: A table with selected form information.</p>
<table border="1" style="border-collapse: collapse; width: 50%;"><colgroup><col style="width: 30%;"><col style="width: 70%;"></colgroup>
<tbody>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">First Name</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${first}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Last Name</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${last}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Company</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${company}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">City</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${city}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">ZIP code</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${code}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Country</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${country}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Email</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${email}</td>
</tr>
<tr style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Choice 1</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${select-1}</td>
</tr>
</tbody>
</table>

Form result text with avoidance
A form result text is configured as an HTML template with parameter replacement.
- Form configuration » Tab: Result
Parameter Success text
<p>The result text of the form: A table with selected form information.</p>
<table border="1px;" style="border-collapse: collapse; width: 50%;"><colgroup><col style="width: 30%;"><col style="width: 70%;"></colgroup>
<tbody>
<tr class="${first|THE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">First name</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${first}</td>
</tr>
<tr class="${last|THE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Last name</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${last}</td>
</tr>
<tr class="${company|DIE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Company</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${company}</td>
</tr>
<tr class="${city|DIE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">City</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${city}</td>
</tr>
<tr class="${code|DIE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">ZIP code</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${code}</td>
</tr>
<tr class="${country|DIE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Country</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${country}</td>
</tr>
<tr class="${email|DIE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Email</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${email}</td>
</tr>
<tr class="${select-1|THE}" style="height: 24px;">
<td style="height: 24px; font-weight: bold; padding: 15px 25px;">Choice 1</td>
<td style="height: 24px; background-color: lightgray; padding: 15px 25px;">${select-1}</td>
</tr>
</tbody>
</table>

Implementing the avoidance of empty spaces
Parameter replacement supports numerous placeholder types and placeholder options:
- Additional Options for Field Placeholders.
- Field-type-specific options for placeholders.
- Management information for submitted data.
Note: The parameter option DIE is used to avoid empty areas. DIE is an acronym for Delete If Empty.
This is a freely configurable flag for all template variants to suppress any area (including rows) if a field value is empty.
The flag is supported in:
- In all PDF template areas:
- Header,
- Footer,
- Document.
- In the email texts of all four email types:
- Administrator: Submit form,
- Administrator: Edit form,
- User: Submit form,
- User: Edit form.
- In the result text after submitting the form.
Procedure
The parameter option DIE is used to avoid empty areas:
- Typically, a Visforms parameter is placed at the position in the template where its replaced field value should appear.
- However, if empty areas are to be avoided, the Visforms parameter is placed with the parameter option ${test|DIE} at the position in the template that should be avoided in the case of an empty field value.
Example for the form field named test: ${test|DIE}
- Avoiding this requires specifying this field placeholder test including the parameter option DIE in the HTML class attribute in the template.
- The area to be suppressed in the template receives this HTML class attribute.
Example of avoiding an HTML table row <tr>. The HTML table row <tr> contains the possibly empty placeholder for the form field named test:
<tr class="${test|DIE}">
<td>Test</td>
<td>${test}</td>
</tr>
Example of avoiding an HTML paragraph <lt;p>. HTML paragraph should not appear if the placeholder for the form field named test is empty:
<p class="${test|DIE}">Accompanying text for the value of the form field 'Test' in the template in case the value is set.</p>
Note: A maximum of 1 DIE placeholder may be inserted per HTML element.
What is considered empty?
As a rule, only empty text is considered ‘empty’. The following exceptions apply:
- In the overhead fields Created By and Modified By, the user ID 0 is considered empty.
The row is therefore removed if it is a guest user. - In the field type Calculation, 0 is considered empty.
Which placeholders support this avoidance?
Overhead fields
The following overhead fields of the record support the parameter option DIE
- Created By: ${created_by|DIE}.
Name of the user who created the record. - Modified By: ${modified_by|DIE}.
User ID of the user who last modified the record. - IP Address: ${ipaddress|DIE}.
IP address for submitting the form.
Form Fields
The following field types support the parameter option DIE.
These are all real input fields, i.e., all form fields except Button, New Page, and Field Separator:
- Text
- Password
- Date
- Number
- URL
- Phone
- Hidden
- Textarea
- Checkbox
- Radio Button
- Listbox
- Checkbox Group
- File Upload
- Calculation
- Location
- Signature
- Radio SQL
- Listbox SQL
- Checkbox Group SQL
Which placeholders are excluded?
Some placeholders for overhead fields in the data record naturally always have a value.
For these overhead fields in the data record, the parameter option DIE makes no sense.
Therefore, the parameter option DIE is not available for the following placeholders:
- Today’s Date: ${currentdate}: The current date.
Because ${currentdate} always returns the current date. - Created: ${created}: Date and time.
If no value is stored in the data table, the current date is always returned. - Modified: ${modified}: Date and time of the last change.
If no value is stored in the data table, the current date is always returned.
Special PDF Templates
The following special PDF templates are available for the PDF template, which already include the parameter option DIE in the relevant places:
- All form fields, labels aligned left, remove blank lines.
- All form fields, labels aligned right, remove blank lines.
- All form fields, formatted, remove blank lines.
These three special PDF templates contain the parameter option DIE on each HTML table row tr, which displays data from a form field.
A PDF template consists of three parts each for the separate template areas:
- Header,
- Footer,
- Document.

Limits
This feature is very general, and many things can be easily implemented with it.
Despite everything, the following limitations apply:
- It is not possible to freely specify what is considered empty during placeholder replacement.
The replacement rules are described in detail above. - A maximum of one placeholder can be placed at each HTML avoidance position to be checked.
It is not possible to use more than one placeholder per HTML position to check avoidance.
If no HTML table is present
Outside of PDF templates, the HTML is less table-based, such as in email templates and the result text. Since the parameter option DIE can also be applied to very small HTML units, all templates not based on an HTML table can also be designed cleanly. One of these very small HTML units is the DIE element.
Avoiding blank spaces on the form summary page
There is a separate configuration setting for avoiding blank spaces on the form summary page.
- Form Configuration » Tab: Advanced » Action
Group: Summary Page » Parameter: Hide empty fields = “Yes”.

Avoiding empty fields in automatically inserted email content
There is a separate configuration setting for avoiding empty fields in automatically inserted email content.
This setting exists in the email configurations for all four email types:
- Form Configuration » Tab: Email Options
Group: Administrator Email » Group: Automatically inserted email content » Parameter: Exclude empty fields = “Yes”.
Group: User Email » Group: Automatically inserted email content » Parameter: Exclude empty fields = “Yes”. - Form Configuration » Tab: Edit Email Options
Group: Administrator Email » Group: Automatically inserted email content » Parameter: Exclude empty fields = “Yes”.
Group: User Email » Group: Automatically inserted email content » Parameter: Exclude empty fields = “Yes”.
