In the below example , we reset the page number once the Employee DeptID gets changed.
Below is the sample XML data.
Load the XML data successfully into RTF template.
After that get the data from Table Wizard and group the data by Deptid with Section break selected.
Below are the snapshots.
Now save the template and see the preview. The page number gets reset for change in DeptID as shown below.