# Importing CSV data type errors

**URL:** <https://forum.uipath.com/t/importing-csv-data-type-errors/255827>\
**Category:** Activities\
**Tags:** question, studio, excel, system, activities\
**Created:** [September 14, 2020, 6:08pm UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827 "2020-09-14T18:08:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Callaghan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/andrew_callaghan/32/176627_2.png) [@Andrew\_Callaghan](https://forum.uipath.com/u/Andrew_Callaghan)\
**Post date:** [September 14, 2020, 6:08pm UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827/1 "2020-09-14T18:08:31Z")

</div>

Apologies if this is in the wrong category. My first time using UiPath today. I have been testing import of a csv but am stuck with what seem like data type errors.

I have a ‘CSV read’ that goes into a foreach. The foreach containa a ‘write line’ to test the import is working.

The CSV:  
VersionNumber,Submitter,Account,AccLstNme,AccEmail,Perms,SubTime,Id0,RsndrsEml  
1,hdfghdfgh,gavin,smith,dfghdfghghgf,Water,12/9/2020 7:35,6,hgfhdfghdfg

I have trying all kind of permutations in setting the variable types but have had no luck.

 ![flow](https://global.discourse-cdn.com/uipath/original/3X/f/b/fb9e6d13626017abc8f1afc4bbecb11d189aa08b.png)

Error:  
Error ERROR Validation Error Compiler error(s) encountered processing expression “AccUser2”.  
Value of type ‘System.Data.DataTable’ cannot be converted to ‘Integer’. Main xaml

Error ERROR Validation Error Compiler error(s) encountered processing expression “row(“VersionNumber”)ToString”.  
End of expression expected. Main xaml

Can you help point me in the right direction

---

<div class="post-metadata">

**Author:** ![Matt\_S](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/matt_s/32/171427_2.png) [@Matt\_S](https://forum.uipath.com/u/Matt_S)\
**Post date:** [September 14, 2020, 8:43pm UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827/2 "2020-09-14T20:43:14Z")

</div>

For one the Index output variable should be an integer, you have a dt variable. Clear that out and try again.

---

<div class="post-metadata">

**Author:** ![yuji.katayose](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yuji.katayose/32/177757_2.png) [@yuji.katayose](https://forum.uipath.com/u/yuji.katayose)\
**Post date:** [September 15, 2020, 12:23am UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827/3 "2020-09-15T00:23:48Z")

</div>

Adding to what Matt\_S have mentioned, you are missing dot before ToString inside Write Line activity.  
`row("VersionNumber")ToString` →   
`row("VersionNumber").ToString`

Before compiling, hover cursor over the blue exclamation mark. You will get much specific error message.

---

<div class="post-metadata">

**Author:** ![Andrew\_Callaghan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/andrew_callaghan/32/176627_2.png) [@Andrew\_Callaghan](https://forum.uipath.com/u/Andrew_Callaghan)\
**Post date:** [September 15, 2020, 9:02am UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827/4 "2020-09-15T09:02:27Z")

</div>

Doh!!! thank you! that worked.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [September 18, 2020, 9:02am UTC](https://forum.uipath.com/t/importing-csv-data-type-errors/255827/5 "2020-09-18T09:02:28Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
