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.

Automatic Table Formatting

Automatically generates a table for user. Just place the formula with embedded field in a separate line:

$formula($related1231231231)

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.

Custom Table Formatting 

If you want to define your own table format, labels, and columns, and set properties like cell width, follow the steps below.

  1. Insert the field variable for the embedded table, such as: $related123123123
  2. Directly below the variable, create a table in Word. The system will use this table to format the information in your embedded table. 
    Tip: 
    If you want to include a header row, format the first row as desired and select Include column headings in table in the print template wizard.
  3. Add and format one, two, three, or more rows as needed:
    1. One row: The entire embedded table is formatted to match this row.
    2. Two rows: If you select Include column headings in table, the first row is used as a header row in the embedded table and the rest of the table is formatted to match the second row.

       If you select Include only table data without headings, odd rows are formatted to match the first row and even rows are formatted to match the second row.
    3. Three rows: If you select Include column headings in table, the first row is used as a header row in the embedded table, odd rows are formatted like the second row, and even rows are formatted like the third row. If you select Include only table data without headings, the third row is included, but not used to format the embedded table. Below is the example of the print format with the static header where settings to exclude/include table headings are completely ignored. Second row is used to define template for the odd data rows, third row defines even data rows.
    4. Additional rows: Any extraneous rows are included as-is in the final document, but not used to format the embedded table. For example, you might include a row with the total cost.
  4. Position the fields by inserting the appropriate field variable in each column heading.
  5. Make sure to test your template to make sure the table size, design, color, and column width looks appropriate with data.

Saved Searches

You can add a saved search to the related table in the print template using the following format:

$related123456789(search:SEARCH_NAME)

Insert Fields From Other Tables

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.

Syntax

$field_from_other_table($table,$id,$field_name)

Examples

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.

 ExampleDescription
$field_from_other_table(clause,44,clause_text)
Insert the value of the clause_text field, from record ID 44 of the Clause table, into the printed document of a contract.
$startif($contract_term_in_months >12)$field_from_other_table(clause,48,clause_text)$endif

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.

Notes

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


Related articles