Developer forum

Forum » Integration »  Excel import cannot parse '1' to an System.Int32

Excel import cannot parse '1' to an System.Int32

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to import an excel file that contains a few columns defines as numbers.

I am using a Data integration job using Excel as source and EcomProvider as a destination.

No matter how I format it, I keep getting the error below.

Import job failed: cannot parse '1' to an System.Int32. Table: EcomVariantsOptions. Column: VariantOptionSortOrder The failed input row is: [VariantOptionId:"DIAM03"], [VariantOptionLanguageId:"LANG1"], [VariantOptionGroupId:"6KTSKR_DIAM"], [VariantOptionName:"3"], [VariantOptionImgSmall:""], [VariantOptionImgMedium:""], [VariantOptionImgLarge:""], [0:"1"]  

I have attached the file I am using.

The solution is 9.8.9.

Thank you,
Adrian 


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Just a note on the file.

The sort column is called "0" because I tried to trick the system in case the first value on the column would define the data type. I have also tried it using the standard column name. In both cases, I got the same result.


Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
problem is that Excel source provider is finding a type for the VariantOptionSortOrder  column as System.Double and then it tries to import it to destination System.Int32 and this is where the exception occurs. Could you somehow edit you excel file so this column is then receive the System.Int32 type in the DI job xml schema?
If not, then you could manually edit the job xml file and set it directly to Int32 instead of Double:
         <column type="Dynamicweb.DataIntegration.Integration.Column">
            <name>0</name>
            <type>System.Int32</type>
            <isNew>False</isNew>
            <isPrimaryKey>False</isPrimaryKey>
          </column>
Kind regards, Dmitrij

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Dmitrij,

Thank you for the explanation.

I have tried setting up the Excel column as Number but I got no luck with it. Probably Number means double anyway.

I will try to find formatting that will force an Int32 column type. 

If not, I will try editing the job.

It would be pretty useful to document this on the site for anybody else having the same issue.

I know it's a long shot and not a priority, but maybe consider adding an option on the DataIntegration mapping for Type?

Thank you,

Adrian

 

You must be logged in to post in the forum