This blog article outlines how to sort data in DocumentsCorePack templates by using the Relationship Designer. This tool allows you to sort your data individually.
Step-by-step description
Step 1: Open Microsoft Word and navigate to www.mscrm-addons.com. Next, click on the Insert MailMerge Fields button and prepare the data you want to sort, e.g. like in the example below.

Step 2: Next, navigate to the ❶ Additional tab on the right side. Select the data table you want to sort – in this case, ❷ Contact (table1) and click the ❸ Edit button.

Step 3: The Relationship Designer window opens, and you can define how you want to sort your data by adding the respective fields you want to sort by (see Figure 3)❶.
The sorting priority is automatically determined by the ❷ order in the list (Prior to v10.45 of the Template Designer it was defined by an integer value). All sorting entries at any level are consistently displayed and can be ❸ rearranged with the up and down arrows and deleted with the minus sign.
Note: If you are using fields from related records the respective sorting field can only be edited within the ❹ correct relationship context.

Please note: This function will sort all records before these are merged. After saving your template and merging it with Dynamics 365 data, the table should look like below.
It is also possible to sort grouped tables. For more information about how to group tables in DocumantsCorePack templates, please look at this blog article.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.