Advanced RowMerge Document Templates

You have already created your first RowMerge template? RowMerge provides a set of variables and syntaxes to generate increasingly sophisticated documents.

One file per row or a single file for all rows?

If you run a RowMerge job on several rows, by default, a ZIP archive is created with a document for each row.

You can specify that you want a single file containing all rows. This is done by adding at the end of the document the {{#onefile}} instruction.

The {{#onefile}} instruction indicates that only one file will be produced, whereas the{{#beginrows}} and {{#endrows}} tags show which area of the template will be repeated for each of your table's rows. In this case, the full document will be duplicated for each row. But you could have a document header that wouldn't be repeated and therefore left outside of the{{#beginrows}} {{#endrows}}section.

You can download the complete example by clicking here.

You can add options to {{#beginrows}} and {{#joinrows}} to limit loading or to sort rows:

  • Min: set to 0 to avoid line breaks
  • Max: Maximum number of rows loaded
  • OrderBy:Name_Of_The_Column: Sorting in ascending order
  • OrderByDescending:Name_Of_The_Column: Sorting in descending order

File Name: #filename

You can edit the name of the generated file(s) by using the command {{#FileName;name_of_file}}:

As illustrated above, you can add the contents of a column to the file name to make it more descriptive: {{#FileName;Name_of_the_file_{Column}}}.

You can download an example here.

Zip Archive File Name: #zipfilename

Similarly, you can edit the name of the generated archive by using the command {{#ZipFileName;name_of_file}}:

You can download an example here.

Get data from several Tables: #joinrows

Ready to go a step further? You can generate a RowMerge document using data from several tables with the {{#joinrows}} instruction.

You need to let RowShare know how tables relate to each other: each other table needs to share one column with your main table. For example, if you want to join a table of tasks and a table of employees to identify the owner of each task, both tables need to list the task owner name or task owner ID.

This instruction follows this format:


Here is the explanation of each parameter:

  • linked_table: the name or id of the external table. If you specify a name, it has to be in the same folder as the table hosting the RowMerge template.
  • column_of_the_current_table: the column name in the table hosting the RowMerge template
  • column_of_the_linked_table: the column name in the other table

 Columns Format

It is possible to specify the display format of your information by using: {{name_of_the_column:format}}.

Here are the main supported formats:

  • {{name_of_the_column:c}}for a currency
  • {{name_of_the_column:p}}for a percentage
  • {{name_of_the_column:d}}for a date
  • {{name_of_the_column:image}}for an image

JavaScript and more

In RowMerge document templates, it's also possible to add JavaScript code and use Word table formulas.

Our team at RowShare is also available to create RowMerge templates for you. Share your need and ask for a quote.

How did we do?