behavior of loop for list under another list

hi all,

we are using wm9.6 (with no fixes or patches)

this is about the general behavior of loop (for list under a list)

my doc structure


i wanted to just loop on right most list loop (input array as doc/docfirstlist[0]/docsecondlist), unfortunately inside loop i can’t loop on the docsecondlist item.

what resolved is having two loops one loop for doc/docfirstlist and under this loop another loop for doc/docfirstlist/docsecondlist

please confirm whats the correct way of looping only on doc/docfirstlist[0]/docsecondlist

any help is appreciated

thanks and regards
ajay kumar kasam

Hi Ajay,

can you map the first item of first list to a new doc?
Then use this doc as input for the loop.

Additional info:
The structure used as input for a loop shows up as a list outside of the loop, but inside the loop it looks like a flat doc with the same inner structure representing the current item for the iteration identified by $iteration-variable.


Hi Ajay,

you can do this in two ways.

  1. you have to use two different loops (first loop over parent list and inside that loop again on child list)
  2. use inbuilt service: pub.document:searchDocuments - in this case you no need to use multiple loops, pass the required keys in the search criteria ti get the child list data…go through the documentation for more details.


I agree with Srikanth on this.