<?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>Validate the excel header</title><link>https://community.appian.com/discussions/f/general/39275/validate-the-excel-header</link><description>implement an Appian Expression Rule that validates the sequence of header values, ensuring that: 
 
 
 The first value is &amp;quot;SAP Number&amp;quot; , 
 
 
 The second value is &amp;quot;Qty&amp;quot; , 
 
 
 The third to sixth values, if present, are &amp;quot;Spare&amp;quot; , &amp;quot;Price&amp;quot; , &amp;quot;Delivery Date</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Validate the excel header</title><link>https://community.appian.com/thread/148902?ContentTypeID=1</link><pubDate>Thu, 12 Jun 2025 06:35:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:06801ff5-fe19-43cf-9e4b-c84a646eb3e9</guid><dc:creator>Yashwanth Akula</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/rishukumarg1965"&gt;Rishu Kumar Gupta&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Use constant for storing the column names.&lt;br /&gt;I hope this is what you are expecting.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!columnNames: {
    &amp;quot;SAP  Number&amp;quot;,
    &amp;quot;Qty&amp;quot;,
    &amp;quot;Spare&amp;quot;,
    &amp;quot;Price&amp;quot;,
    &amp;quot;Delivery Date&amp;quot;,
    &amp;quot;Remarks&amp;quot;
  },
  local!excelDataSubset: readexcelsheetpaging(
    excelDocument: ri!excelDoc,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1)/*batchsize is 1 Because we need only first row from the excel to validate, which will be column names*/
  ),
  local!columnsNamesFromExcel: index(
    local!excelDataSubset,
    &amp;quot;data&amp;quot;,
    &amp;quot;values&amp;quot;,
    1,
    {}
  ),
  reject(
    a!isNullOrEmpty,
    a!forEach(
      items: local!columnNames,
      expression: if(
        contains({ 1, 2 }, fv!index),
        /*mandatory check for first two columns*/
        if(
          tostring(
            index(
              local!columnsNamesFromExcel,
              fv!index,
              &amp;quot;&amp;quot;
            )
          ) = tostring(fv!item),
          null,
          concat(
            &amp;quot;Invalid header at A&amp;quot;,
            fv!index,
            &amp;quot;, Expected header is &amp;#39;&amp;quot;,
            fv!item,
            &amp;quot;&amp;#39; but it has: &amp;quot;,
            index(
              local!columnsNamesFromExcel,
              fv!index,
              &amp;quot;&amp;quot;
            )
          )
        ),
        if(
          a!isNullOrEmpty(
            index(
              local!columnsNamesFromExcel,
              fv!index,
              &amp;quot;&amp;quot;
            )
          ),
          null,
          if(
            tostring(
              index(
                local!columnsNamesFromExcel,
                fv!index,
                &amp;quot;&amp;quot;
              )
            ) = tostring(fv!item),
            null,
            concat(
              &amp;quot;Invalid header at A&amp;quot;,
              fv!index,
              &amp;quot;, Expected header is &amp;#39;&amp;quot;,
              fv!item,
              &amp;quot;&amp;#39; but it has: &amp;quot;,
              index(
                local!columnsNamesFromExcel,
                fv!index,
                &amp;quot;&amp;quot;
              )
            )
          )          
        )
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validate the excel header</title><link>https://community.appian.com/thread/148895?ContentTypeID=1</link><pubDate>Thu, 12 Jun 2025 05:16:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c69ddf44-6b81-4e1f-b555-c377e94ba9e2</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&lt;span&gt;You can read data from Excel files using the Excel Tools plugin and its associated smart services. For more information, please refer to the following resources:&lt;br /&gt;&lt;br /&gt;Excel Tools plugin documentation:&amp;nbsp;&lt;a href="/b/appmarket/posts/excel-tools"&gt; https://community.appian.com/b/appmarket/posts/excel-tools&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;The attached documentation for additional details&lt;/span&gt;&lt;br /&gt;.&lt;a href="https://community.appian.com/cfs-file/__key/communityserver-discussions-components-files/11/readExcelByHeaders.pdf"&gt;community.appian.com/.../readExcelByHeaders.pdf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>