The RowNumber parameter numbers the rows of a table automatically when the document is generated. Use it in tables with many records, such as itemized lists, invoices, quotes and data summaries, so readers can refer to entries by number.

Syntax

{{RowNumber}}

Values

RowNumber takes no values. It outputs the number of the current row: 1 for the first merged record, 2 for the next, and so on. The numbers increase with each record that is merged, so the numbering always matches the records in the table.

Where to add it

Put {{RowNumber}} in the first column of the repeating table row in your Word template, after {{TableStart:…}}. This keeps the table layout clear.

Example

An opportunity has three line items.

Template row:

Item no.NameQuantityPrice
{{TableStart:Opportunity.r.OpportunityLineItems}}{{RowNumber}}{{Name}}{{Quantity}}{{TotalPrice}}{{TableEnd:Opportunity.r.OpportunityLineItems}}

Output: the Item no. column shows 1, 2 and 3, one number per line item.

The generated document numbers each line item:

Generated line item table with each row numbered from 1

Works in

RowNumber works inside a TableStart/TableEnd row. The examples on this page use Word (DOCX) templates.

Notes

RowNumber replaces the legacy TableRow syntax. See Use the TableRow parameter (legacy).

Common errors