<?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>Validating empty excel file upload</title><link>https://community.appian.com/discussions/f/general/13956/validating-empty-excel-file-upload</link><description>Hi, how to validate an empty excel file while uploading using file upload component. Parse Excel to CDT smart service fails if the excel sheet is blank.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/112837?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 12:35:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:13a60b61-35ba-45fe-82e7-eceb3658acb2</guid><dc:creator>akanshab1610</dc:creator><description>&lt;p&gt;Please explain in detail&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/63389?ContentTypeID=1</link><pubDate>Thu, 13 Dec 2018 06:36:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c9ef1414-7d77-46df-ba05-2826cd2c3794</guid><dc:creator>Sharmila Nagaraj</dc:creator><description>Thanks Athira, it works.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/63356?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 11:23:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c2767684-aaa5-40f7-8c50-25ad52480594</guid><dc:creator>Athira Vinodkumar</dc:creator><description>Hi  ,&lt;br /&gt;
I guess if you have to validate and check whether the uploaded excel is empty, you can use the below logic in a rule that executes in the process model(in a script task node) after submission of the form (because only after submission the document can be accessed for any validations). If the rule returns any validation, the flow has to loop back to the UIT without taking the parse excel to cdt node path.&lt;br /&gt;
&lt;br /&gt;
-----------------&lt;br /&gt;
with(&lt;br /&gt;
  local!excelData: readexcelsheet(&lt;br /&gt;
    ri!document,&lt;br /&gt;
    0,&lt;br /&gt;
    0&lt;br /&gt;
  ),&lt;br /&gt;
  local!excelDataOnSuccess: if(&lt;br /&gt;
    toboolean(&lt;br /&gt;
      local!excelData.success&lt;br /&gt;
    ) = false(),&lt;br /&gt;
    null,&lt;br /&gt;
    remove(&lt;br /&gt;
      local!excelData.result,&lt;br /&gt;
      where(&lt;br /&gt;
        a!forEach(&lt;br /&gt;
          items: local!excelData.result.values,&lt;br /&gt;
          expression: length(&lt;br /&gt;
            fv!item&lt;br /&gt;
          ) = 0&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  if(&lt;br /&gt;
    rule!APN_isNullOrEmpty(&lt;br /&gt;
      local!excelDataOnSuccess&lt;br /&gt;
    ),&lt;br /&gt;
    &amp;quot;Uploaded document is empty&amp;quot;,&lt;br /&gt;
    if(&lt;br /&gt;
      length(&lt;br /&gt;
        local!excelDataOnSuccess.values&lt;br /&gt;
      ) &amp;lt;= 1,&lt;br /&gt;
      &amp;quot;Uploaded document doesn&amp;#39;t have data&amp;quot;,&lt;br /&gt;
      {}&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
------------------&lt;br /&gt;
Here ri!document is of type document,the string that the rule returns(if that string it is not null), it can be displayed as a rich text on the UIT on loop back. I hope this might help you.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Athira&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/63334?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 05:37:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:351ab460-e066-4d06-90bc-8253ec3862e1</guid><dc:creator>Sharmila Nagaraj</dc:creator><description>On the second point, the Parse Excel to CDT smart service node itself fails if we try to parse the data, hence doing a null check is not possible.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/63333?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 05:11:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65f12f3d-ad17-4226-b4de-8433bd268387</guid><dc:creator>Shanmukha</dc:creator><description>This can be done only when you you have use case something like this.&lt;br /&gt;
&lt;br /&gt;
There is a form/UI where you have a file uplaod field and the uploaded file must be based on some template (which is already present in appian) and then nely uploaded file you can check the uploaded file size with the template file size. This is just a try you can check it with couple of other scenarios as well. &lt;br /&gt;
&lt;br /&gt;
Apart from above I don&amp;#39;t see any other way to do this. Let&amp;#39;s see what other folks will say about it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validating empty excel file upload</title><link>https://community.appian.com/thread/63332?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 05:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dd90c411-3141-4cb3-8ea6-997772ed021a</guid><dc:creator>sindhug</dc:creator><description>Hi Sharmilan,&lt;br /&gt;
&lt;br /&gt;
We can check below 2 uses cases to resolve the issue.&lt;br /&gt;
&lt;br /&gt;
1. Check the size of the excel file after uploading. check whether  is it displaying 0 KB or not accordingly display validation message.&lt;br /&gt;
&lt;br /&gt;
2. If the above use case fails  , try to do null check for the CDT after parsing the excel sheet. If CDT returns null, navigate the flow to UI to display a proper validation message.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Sindhu&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>