The RowCount parameter calculates and shows the total number of related records (rows) in a table in your document.

Syntax

{{RowCount:Object.RelationshipName}}

Values

ComponentEffect
Object.RelationshipNameThe child relationship to count, for example Account.r.Contacts. Use the same relationship as the table's TableStart and TableEnd.

Where to add it

Type the RowCount merge field in your Word template where you want the count to appear, for example below the table.

Example

An account has several contacts.

Template:

First nameLast nameDepartmentPhone
{{TableStart:Account.r.Contacts}}{{FirstName}}{{LastName}}{{Department}}{{Phone}}{{TableEnd:Account.r.Contacts}}

No. of contact persons: {{RowCount:Account.r.Contacts}}

Output: one row per contact, followed by "No. of contact persons:" and the total number of contacts.

The generated document shows the table and the count:

Generated contacts table followed by the total number of contacts

Works in

The example on this page uses a Word (DOCX) template.

Notes

RowCount replaces the legacy TableRow syntax for row totals. See Use the TableRow parameter (legacy).

Common errors