Embedded tables, such as a Related Table or Link to Selected Fields with MVE can be included in print templates. There are two ways to format embedded tables, outlined below. This article also explains how to include an embedded table with a specific saved search, and how to embed fields from other tables.
Automatically generates a table for user. Just place the formula with embedded field in a separate line:
With automatically generated tables, the system creates the table according to the defined view for the embedded table, using automatically calculated cell widths. In these cases, there's no need for user to draw table/define columns at all.
If you want to define your own table format, labels, and columns, and set properties like cell width, follow the steps below.
You can add a saved search to the related table in the print template using the following format:
Use the following syntax to insert variables from records in other tables. This syntax differs from standard field variable chains because the inserted variable does not have to be connected by a linked record. For example, this makes it possible to insert text or other data from a specific record into a print template or formula in any other record, such as adding a contract clause to contract tempates using variables from a Clause Library table.
Consider the following table setup:
Note: In the above example, the clause_text and clause_title fields are not directly or indirectly linked to the contract.
|Insert the value of the clause_text field, from record ID 44 of the Clause table, into the printed document of a contract.|
Show clause text from record ID 48 if the Contract Term in Months is greater than 12, using a $startif condition to reference the local variable.
The $field_from_other_table(clause,44,clause_text) string cannot be used for statements that use the $if condition. For example:
$if($contract_term_in_months < 12)? $field_from_other_table(clause,44,clause_text): $field_from_other_table(clause,48,clause_text)
However, you can use two pairs of $startif and $endif statements instead. For example:
$startif($contract_term_in_months < 12)$field_from_other_table(clause,44,clause_text)$endif $startif($contract_term_in_months >=12)$field_from_other_table(clause,48,clause_text) $endif
clause_textfield in this example, that field variable may contain variables that reference the main table, such as
$field_from_other_table(clause,44,clause_text), the system first evaluates the clause_text field from Clause table's record 44, and then resolves the included reference to
$contract_start_datefrom the contract record where the print template runs.
While resolving variables from a secondary table record, the view permissions of the field are checked. If the user running a print template does not have view permissions for the field being referenced, then that field value is not resolved in the resulting document.
$startifcondition and the condition is not met, the line will be left empty in the resulting template.