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.
As a result, the generated document also includes the empty fields.
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:
In the MS Word document, place the cursor on the field of interest, for example, on the "Contact Person" field.
Right-click, select the "Edit Field" option in the dropdown menu, and the Field form will be displayed.
To remove the paragraph, add the
#dpsuffix to the field name.
Add the same suffixes to the "Photo" fields.
Save the changed document template and upload it to TeamDesk.
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.
As a result, if there are no values in the "Company" field, the corresponding row will be deleted.
Example 3: Removing a Table
To remove a whole table, add the
#dt suffix to the field name.
As a result, if there are no values in the "Invoices/Invoice" field, the entire "Invoices" table will be deleted.