Looping through multiple Embedded data thru JSP tags

Hi,

I’m trying to iterate through a property named Answers using JSP tags that’s nested inside multiple layers of embedded data.Specifically, I have:

  • An embedded data with a list of records,

    • which contains an embedded single-record data,

      • and within that, another embedded data with a list of records. (Answers List)

I tried using the syntax below, but it’s throwing an error. Could you please suggest the correct syntax for looping through this nested structure?

Syntax I tried to use:

<pega:forEach name=".OuterEmbeddedListRecords"> 

         <pega:forEach name="$THIS.InnerEmbededSingleRecord"> 

                    <pega:forEach name="$THIS.AnswersList"> 

                             <pega:reference name='$THIS.Answers' />

                    </pega:forEach>

       </pega:forEach>

</pega:forEach>

Thanks!

This is solved. Syntax I used:


```
<pega:forEach name=".OuterEmbeddedListRecords">
       <pega:withEmbedded name="$this" >
            <pega:forEach name=".InnerEmbeddedSingleRecord.AnswersList">
                  <pega:reference name="$this.Answers" />
             </pega:forEach>     
       </pega:withEmbedded>
</pega:forEach>
```