Extensions to Documents

TeamDesk provides support for removing the enclosing paragraph, table row, or table when a field’s value is empty. You can edit document templates and add suffixes to remove a paragraph (#dp), table row (#dr), or table (#dt).

These features may help adjust the document layout dynamically based on the presence or absence of some information in a database.

Example 1: Removing a Paragraph

You have created the "Service Form" document template, including the "Contact Person" field and "Photo" fields. These fields can contain empty values when the Contact Person is not indicated or there are no attached photos.

Old Document Template

As a result, the generated document also includes the empty fields.

Old Document

To remove the enclosing paragraph when a field’s value is empty, you need to edit the corresponding fields of the document template as follows:

  1. In the MS Word document, place the cursor on the field of interest, for example, on the "Contact Person" field.

  2. Right-click, select the "Edit Field" option in the dropdown menu, and the Field form will be displayed.

  3. To remove the paragraph, add the #dp suffix to the field name.
    Edit Field

  4. Add the same suffixes to the "Photo" fields.
    New Document Template

  5. Save the changed document template and upload it to TeamDesk.
    Generated Updated Document

As a result, if there are no values in the "Contact Person" and "Photo" fields, the corresponding paragraphs are deleted.

Example 2: Removing a Table Row

To remove a table row, add the #dr suffix to the field name.

Remove empty row

As a result, if there are no values in the "Company" field, the corresponding row will be deleted.

Table Without the Row

Example 3: Removing a Table

To remove a whole table, add the #dt suffix to the field name.

Deleting Table

As a result, if there are no values in the "Invoices/Invoice" field, the entire "Invoices" table will be deleted.

Deleting Table Result