How to sort data in repeat blocks in merge templates
Overview
You can organize your repeat table data by sorting it using specific merge fields. For example, to list employees by department, and then by their date of joining within each department, use the 'Sort Repeat Records' feature in Zoho Writer. This helps you present your data in a clear and structured way.
This supports multiple column sorting to organize your repeat table data more precisely. You begin with a primary sort—for example, by employee department. Then, you can apply a secondary sort, such as by date of joining, to further arrange the data within each department group. This ensures a well-structured, multi-level sort in your merged document.
Prerequisites
Ensure the following prerequisites are met:
-
Merge Template: Create a Zoho Writer document with merge fields.
Field Mapping: Each data source field should be mapped to a corresponding merge field.
-
Connected Data Source: Link your template to a supported data source such as Zoho CRM, Zoho Creator, Zoho Forms, Zoho Sheet, or an external source via API.
Steps
- In the template, insert a repeat table containing the necessary fields. Note that you can choose between a simple repeat, row repeat, or any other type of repeat region.
- Right-click on the field by which you intend to sort your repeat data. From the drop-down menu, select Sort Repeat Records.
- For Simple Repeat block
Please cursor inside the block and right click and choose to Sort Repeat Records
b. For Repeat table block
- Primary sorting: Next, select the field you wish to sort by. Specify the field type (e.g., text, date, number), and indicate whether you want the data sorted in ascending or descending order.
Secondary sorting: Specify a secondary merge field(date of joining) in Then by to sort the data within each group created by the primary sorting.
- Click on Sort to initiate the sorting process. Then, preview your merge to ensure that the data is sorted as desired.
Related Articles / Videos