Document Solutions for Word
Report Templates / Template Configuration / Loops and Nesting
In This Topic
    Loops and Nesting
    In This Topic

    Report Templates allow you to create repeating objects by specifying one repeating object inside the other. This is helpful while implementing complex use case scenarios.

    For example, the below sample data represents a complex object with a few nested objects and collections for a student's grade card.

    JSON
    Copy Code
    [
         {
             ""name"": ""Richard"",
             ""school"": [
                 {
                     ""name"": ""Montessori"",
                     ""curriculum"": [
                         {
                             ""category"": ""Dance"",
                             ""achievement"": [
                                 {
                                     ""description"": ""Performed in inter-school events""
                                 }
                             ]
                         }
                     ],
                     ""student"": [
                         {
                             ""subject"": ""English"",
                             ""grade"": ""8"",
                             ""remarks"": ""Good pick-up but there is scope of improvement in grammar""
                         }
                     ]
                 }
             ]
         }
     ]

    The template layout contains a table containing placeholder fields for the subject, grade and its remarks. It also defines nested fields for Co-Curricular activities and their respective achievements.

    The output of above template layout is shown below. The final Word document will  contain repeated data for different students, if provided in the data source.