<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Nested loops inside the DOCX template with XML as data source</title><link>https://community.appian.com/discussions/f/general/21743/nested-loops-inside-the-docx-template-with-xml-as-data-source</link><description>What&amp;#39;s the best practice for this use case? 
 
 I have XML with the data similar to this: 
 
 
 In DOCX document i would like to achieve this: 
 
 
 
 So, how can I configure my template to loop inside the loop? 
 
 I believe it would be something like</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Nested loops inside the DOCX template with XML as data source</title><link>https://community.appian.com/thread/85103?ContentTypeID=1</link><pubDate>Mon, 30 Aug 2021 03:58:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df2efcd6-ce32-4cab-bdf6-044356a6365a</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/ivanm0004"&gt;ivanm0004&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Working with complex structure XML (Multi level), in freemarker can be trick but you can apply some workarounds.&lt;/p&gt;
&lt;p&gt;To implement your scenario I changed a little bit your input XML as well as your template. Please see the format that I used in my implementation:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;project&amp;gt;
	&amp;lt;employee &amp;gt;
		&amp;lt;details name=&amp;quot;JOHN&amp;quot; lastName=&amp;quot;SMITH&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;JAN&amp;quot; amount=&amp;quot;2000&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;FEB&amp;quot; amount=&amp;quot;2100&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;MAR&amp;quot; amount=&amp;quot;2123&amp;quot; /&amp;gt;
	&amp;lt;/employee&amp;gt;
	&amp;lt;employee &amp;gt;
		&amp;lt;details name=&amp;quot;JACOB&amp;quot; lastName=&amp;quot;SMITH&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;JAN&amp;quot; amount=&amp;quot;3000&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;FEB&amp;quot; amount=&amp;quot;3100&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;MAR&amp;quot; amount=&amp;quot;3123&amp;quot; /&amp;gt;
	&amp;lt;/employee&amp;gt;
	&amp;lt;employee &amp;gt;
		&amp;lt;details name=&amp;quot;JOSE&amp;quot; lastName=&amp;quot;SMITH&amp;quot; /&amp;gt;	
		&amp;lt;salary month=&amp;quot;JAN&amp;quot; amount=&amp;quot;4000&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;FEB&amp;quot; amount=&amp;quot;4100&amp;quot; /&amp;gt;
		&amp;lt;salary month=&amp;quot;MAR&amp;quot; amount=&amp;quot;4123&amp;quot; /&amp;gt;
	&amp;lt;/employee&amp;gt;
&amp;lt;/project&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The template was configured like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1630295519325v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The result document is:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1630295589790v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps&lt;/p&gt;
&lt;p&gt;Acacio B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nested loops inside the DOCX template with XML as data source</title><link>https://community.appian.com/thread/85048?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 12:12:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:405c36e2-6431-4433-b0bf-8f95a2adc59d</guid><dc:creator>gayathris876948</dc:creator><description>&lt;p&gt;Try like&amp;nbsp;#list doc.employeeData.salary in the first cell. Lets see how its work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>