<?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>Write to excel template - insert rows dynamically in excel template in process model</title><link>https://community.appian.com/discussions/f/general/38566/write-to-excel-template---insert-rows-dynamically-in-excel-template-in-process-model</link><description>Hello Team, 
 We have a requirement to populate data into an excel template which will spawn for multiple sheets. This would be in a process model as we fetch the data to populate from a rest service. 
 We were able to achieve populating data into the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Write to excel template - insert rows dynamically in excel template in process model</title><link>https://community.appian.com/thread/146923?ContentTypeID=1</link><pubDate>Fri, 04 Apr 2025 12:36:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb22856a-a1d5-4ea5-b8df-85ac60668770</guid><dc:creator>Chirag Singodiya</dc:creator><description>&lt;p&gt;&lt;strong&gt;Approach:&lt;/strong&gt; Generate Excel cell positions dynamically based on data and create a list of cell positions and values.&lt;br /&gt;&lt;br /&gt;Steps to dynamically insert rows in Excel using Export Data Store Entity to Excel Smart Service -&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a rule to generate cell positions for Excel export dynamically:&lt;br /&gt;Rule Name:&amp;nbsp;&lt;strong&gt;PA_generatePositionsForExcelExport&lt;/strong&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
    a!isNullOrEmpty(ri!rowNumber),
    ri!startingPosition,
    concat(
        stripwith(ri!startingPosition, &amp;quot;0123456789&amp;quot;),
        tointeger(ri!startingPosition) + (ri!rowNumber - 1)
    )
)

    /*Input -&amp;gt; startingPosition: A1 and rowNumber: 4*/
    /*Output -&amp;gt; A4*/&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Create a rule for excel cell positions and values&lt;br /&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: { { id: 1, name: &amp;quot;John&amp;quot; }, { id: 2, name: &amp;quot;Tom&amp;quot; } },
  local!startingPosOfId: &amp;quot;A1&amp;quot;,
  local!startingPosOfName: &amp;quot;B1&amp;quot;,
  local!mapping: a!forEach(
    items: local!data,
    expression: {
      a!map(
        position: rule!PA_generatePositionsForExcelExport(
          startingPosition: local!startingPosOfId,
          rowNumber: fv!index
        ),
        value: fv!item.id
      ),
      a!map(
        position: rule!PA_generatePositionsForExcelExport(
          startingPosition: local!startingPosOfName,
          rowNumber: fv!index
        ),
        value: fv!item.name
      )
    }
  ),
  a!map(
    positions: index(local!mapping, &amp;quot;position&amp;quot;, null),
    value: index(local!mapping, &amp;quot;value&amp;quot;, null)
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Use the rule created in step 2 as inputs in Export Data Store Entity to Excel Smart Service&lt;br /&gt;&lt;br /&gt; Input: Custom Cell Positions - index(rule!PA_excelCellPositionsAndValues, &amp;quot;positions&amp;quot;, null)&lt;br /&gt; Input: Custom Cell Values - index(rule!PA_excelCellPositionsAndValues, &amp;quot;values&amp;quot;, null)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span data-preserver-spaces="true"&gt;For the second&amp;nbsp;requirement, you can use the&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&lt;span data-preserver-spaces="true"&gt;Delete Excel Sheet&lt;/span&gt;&lt;/strong&gt;&lt;span data-preserver-spaces="true"&gt;&amp;nbsp;smart service from the&amp;nbsp;&lt;/span&gt;&lt;a class="editor-rtfLink" href="/b/appmarket/posts/sql-to-excel" rel="noopener noreferrer" target="_blank"&gt;&lt;span data-preserver-spaces="true"&gt;SQL to Excel&lt;/span&gt;&lt;/a&gt;&lt;span data-preserver-spaces="true"&gt; plugin.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write to excel template - insert rows dynamically in excel template in process model</title><link>https://community.appian.com/thread/145528?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 22:40:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:113c3c44-b5aa-40b8-87bb-9e621a6f10e0</guid><dc:creator>padmanabant852500</dc:creator><description>&lt;p&gt;Thanks for your response. But we have no issue in populating the excel template using &amp;quot;&lt;span&gt;Export Data Store Entity to Excel Smart Service&lt;/span&gt;&amp;quot;. But this wouldn&amp;#39;t insert rows into excel sheet.&lt;/p&gt;
&lt;p&gt;As the excel template is &amp;#39;quite a template&amp;#39; with its own formats and could change periodically - we don&amp;#39;t want to replicate that into an HTML - which will inflict lot of work into Appian and&amp;nbsp;push us to do change the HTML consistently.&lt;/p&gt;
&lt;p&gt;Feel free to suggest an alternatives if you come across.&lt;/p&gt;
&lt;p&gt;Thanks again for your time for thinking through this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write to excel template - insert rows dynamically in excel template in process model</title><link>https://community.appian.com/thread/145527?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 20:43:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6298c144-bf06-46eb-99bb-1c0e9a2f93e0</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;YOu can generate HTML documents for each one of the sheets, and after use Excel Tools to convert that documents into Excel.&lt;/p&gt;
&lt;p&gt;And use Excel utilities to merge files deleting duplicates.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.appian.com/b/appmarket/posts/excel-tools"&gt;community.appian.com/.../excel-tools&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://community.appian.com/b/appmarket/posts/excel-utility"&gt;Excel Utility&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another option would be to genereate a Json, and use Json to excel plugin to generate your file, and delete duplicates in that json....&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway, I would suggest to clean data before inserting into excel documents&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>