Skip to content

Tables, conditions, images and barcodes

Use a repeating table for line items, contacts, or any list of child records.

  1. Put your cursor where the table should go.
  2. On the Build tab, open Related lists (repeating tables) and click the relationship you want, for example Contacts or Products (Line Items). + Table in the bottom bar takes you to the same section.
  3. Tick the child fields you want as columns.
  4. Click Insert table in the bar at the bottom of the pane. Cancel is beside it, and the ‹ arrow at the top left goes back without inserting anything.

The add-in inserts a table with two rows: a header row with your column labels, and a data row that repeats once for each child record when the document is generated. Three contacts give three rows.

You can style the table (borders, shading, widths) like any Word table. Just do not delete the merge fields in the data row.

Filter and sort (optional). Choose a field, an operator and a value to limit which records appear, and a sort field and direction to set their order. For example, {{#Opportunities WHERE Opportunities.Amount > 10000}} shows only opportunities over 10,000, and ORDER BY CloseDate DESC lists the latest close date first. To change a list’s filter later, click its {{#…}} tag in the document and use the Edit card.

The same panel can insert a list inside a list, one level deep: for example, each opportunity, then each of its line items.

  1. Under Nested related list, pick the child’s own related list.
  2. Tick the fields you want at each level.
  3. Click Insert nested list. This button is inside the Nested related list section, not in the bottom bar.

Each parent record gets a heading line, followed by a table of its child records. This is the classic grouped-invoice layout. The outer {{#…}} and {{/…}} tags sit on their own lines above and below the table. Keep them there.

Do not type a nested list by hand inside a table cell. It would repeat the whole row and blank its other fields, so Save refuses it and explains the fix. Put the outer {{#…}} and {{/…}} tags on their own lines around the table instead, which is what the panel does.

Insert total, in its own section of the same panel, adds a SUM, COUNT, AVG, MIN or MAX over a related list. For example, {{SUM:OpportunityLineItems.TotalPrice:currency}} or {{COUNT:Contacts}}. Put a total outside the table.

Every object’s related lists include Approval History: a repeating table of the record’s approval steps (who acted, step status, comments, dates). It works like any other related list, except that you cannot add totals to it.

  1. Optionally, select the text you want to show or hide.
  2. Click + Condition.
  3. Choose a field, an operator (=, ≠, >, <, ≥, ≤, or contains for “this text appears anywhere in the field”), and a value.
  4. Tick NOT to reverse the rule. Tick Include an otherwise (else) branch if you want other text to show when the rule is false. You can add a second rule, joined with AND or OR.
  5. Click Insert in the bottom bar.

For example, a condition on Annual Revenue > 50000 wraps your selected text so it only appears for high-revenue accounts. With an else branch, you could show “Premium tier” when it is true and “Standard tier” when it is false.

Click More ▾, then + If blank, and pick a field. The content between the tags appears only when that field is empty. This is handy for messages like “No notes on file”.

+ Image (under More ▾) inserts a picture from a field that holds a Salesforce File, with an optional size, for example {{%Account.Logo__c:200x60}}. The picture is added when the document is generated.

  1. Click More ▾, then + Barcode.
  2. Pick the field to encode, such as an invoice number or a URL.
  3. Choose Code 128 or QR, and optionally set a size.
  4. Click Insert (or Update, if the barcode tag is already in the document).

The barcode is drawn into the document when it is generated. The tags look like {{*Account.AccountNumber}} and {{*Account.Website:qr:150}}. See Barcodes and QR codes for how they render.