<?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>On using import excel to database smart service getting this error : Incorrect integer value: &amp;#39;&amp;#39; for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/discussions/f/general/20960/on-using-import-excel-to-database-smart-service-getting-this-error-incorrect-integer-value-for-column-appian-tablename-palletqtyno-at-row-1</link><description>I am trying to use import excel to database smart service for importing my data from excel into appian table. 
 
 In my CDT i have columns of text and integer type. But when trying to use the excel file with integer column as blank it is throwing me error</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81733?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 15:59:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa6aafc6-946a-4eb1-a269-22bd1c8a33d1</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;Thanks Chris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81732?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 15:40:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:81740759-4e88-49cc-b9a6-c543e2579578</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Great!&amp;nbsp; If you are utilizing this new rule within a process model, you will save the output into a process variable of type&amp;nbsp;&lt;span&gt;Brexit_shipment_tracker (multiple),&lt;/span&gt;&amp;nbsp;then persist to the database utilizing the &lt;a href="https://docs.appian.com/suite/help/21.1/Write_to_Data_Store_Entity_Smart_Service.html"&gt;Write to Data Store Entity smart service&lt;/a&gt;.&amp;nbsp; Note you can also write the data within a SAIL form using &lt;a href="https://docs.appian.com/suite/help/21.1/recipe-use-the-write-to-data-store-entity-smart-service-function-on-an-interface.html"&gt;a!writeToDataStoreEntity()&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81730?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 15:18:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b5f60560-4018-4ef0-a55b-1c1a0001c3da</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;Yes now the code is working....But i have one doubt, as I got the output but how to write this into database ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81727?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 14:53:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:62a04ab5-1c84-4518-ab0f-87aa0536420a</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Ah yes, my sample code needs adjustment - as you have found, the result is actually a list of text string within local!data.result.values, vs a list of dictionary.&amp;nbsp; fv!item.values[2] or index(fv!item.values,2,null) would be the way to go.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!data: fn!readexcelsheet(cons!CHRIS_TEST_SP_DOC,0,2), /* get the data */

  if(
    local!data.success, 
    a!forEach( 
      items: local!data.result,
      expression: &amp;#39;type!{urn:com:gdit:types}COE_Sample_CDT&amp;#39;(
        id: null,
        approval: index(fv!item.values,1,null),
        requestByName: index(fv!item.values,2,null),
        requestById: index(fv!item.values,3,null),
      )
    ),
    {}
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81726?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 14:32:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:301895f5-cfbd-475d-b34e-3e88ec0d32d1</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;I have already check that...&lt;span&gt;local!data.result is returning the row with correct data b&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also&amp;nbsp;if I am using the expression as &lt;strong&gt;status: fv!item.values[2] &lt;/strong&gt;instead of using&lt;strong&gt; status:property(fv!item,&amp;quot;status&amp;quot;,null)&amp;nbsp; i&lt;/strong&gt;s giving value for that field&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what can be the reason ? may be some issue with&amp;nbsp;&lt;strong&gt;property(fv!item,&amp;quot;status&amp;quot;,null) expression ??&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81725?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 14:27:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:59115f9e-97d0-40dc-8208-54bf1eae7e87</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;For debugging, I would suggest commenting out the if() statement in it&amp;#39;s entirety and use just &amp;quot;local!data.result&amp;quot; as the output - that will show us what is being read in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81687?ContentTypeID=1</link><pubDate>Sat, 15 May 2021 14:51:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:685c6977-777c-4bde-9258-338fc8c475ec</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/5224.Capture1.JPG" /&gt;&lt;br /&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using below expression but it is returning null values from column in excel:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!data: fn!readexcelsheet(cons!Test_cons_Doc,0,2),&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if(&lt;br /&gt; local!data.success,&amp;nbsp;&lt;br /&gt; a!forEach( &lt;br /&gt; items: local!data.result,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; expression: &amp;#39;type!{urn:com:appian:types:Brexit}Brexit_shipment_tracker&amp;#39;(&lt;/p&gt;
&lt;p&gt;srn_asn_number: property(fv!item,&amp;quot;srnasnnumber&amp;quot;,null),&lt;br /&gt; status: property(fv!item,&amp;quot;status&amp;quot;,null)&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; {}&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;am I providing any wrong input ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81666?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 17:01:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:61d87337-b40b-4f29-a3c4-854afb45eb21</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;Thanks I will check with this code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81665?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 16:50:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c163b524-927c-4b98-bb28-44d6146ae2ff</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;I&amp;#39;ll include some sample code below.&amp;nbsp; This reads an excel file and creates a List of CDT, for each item in the file.&amp;nbsp; The output can be written to the DB using Write to Datastore Entity.&amp;nbsp; This can also be modified to accept the document as a rule input, then you can save as a rule and call it in your process model, save to CDT and write from there.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can test this by uploading one of your Excel files to /design, point a constant to it, then modify this code to reference your constant and the CDT pointing to your table.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!data: fn!readexcelsheet(cons!CHRIS_TEST_SP_DOC,1,1), /* get the data */
  
  if(
    local!data.success, /* cast when the read was successful */
    a!forEach( 
      items: local!data.result, /* loop all rows in the excel file */
      expression: &amp;#39;type!{urn:com:gdit:types}COE_Sample_CDT&amp;#39;(
        id: null,
        approval: property(fv!item,&amp;quot;approval&amp;quot;,null), /* retrieve values with property() */
        requestByName: property(fv!item,&amp;quot;requestByName&amp;quot;,null),
        requestById: property(fv!item,&amp;quot;requestById&amp;quot;,null),
      )
    ),
    {}
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Feel free to play around with it and let us know if you have any additional questions.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81664?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 16:40:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:31e19bfb-b267-4847-ad3a-9d718c7ebfb1</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;How do we cast raw data from readexcelSheet() to CDT ...???&lt;/p&gt;
&lt;p&gt;Can you please tell me the steps as I am new to appian &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81663?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 16:30:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3fa331b0-2868-4c75-824f-a90815f6ba6a</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Working with Excel import/export can be a little finicky at times, especially related to data types.&amp;nbsp; I am not that familiar with this node - typically I will utilize fn!readexcelsheet() to import raw data, then cast it to a CDT, then write the CDT to the database with Write to Datastore Entity.&amp;nbsp; This allows you to avoid some of these issues with going straight to the DB and perform any manipulations, casting, etc in between as needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81662?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 16:19:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8259f666-7ee9-45a8-82b3-9b2db277250b</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;Yes null is allowed and data type is integer &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On using import excel to database smart service getting this error : Incorrect integer value: '' for column `Appian`.`tablename`.`palletqtyno` at row 1???</title><link>https://community.appian.com/thread/81661?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 15:55:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ac54c4b-42e0-4609-ad66-87b56a11b229</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Is your palletqtyno field configured to allow null values at the DB level?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>