Get row item exception - Robot is reading values from two columns instead of one

csv
studio
exception

#1

Hello,

I am in the first video ‘Level 1 - Foundation Training’, and trying to run the first created flow chart, where the robot reads from the .csv file the first row. I created and saved this CSV file with the same values as per the video, therefore for example the first row has the values ‘21’ (‘CashIn’ column) and 17 (‘NotOnUsCheck’ column). When I run the robot, I get the error

MyFlowChart has thrown an exception

Source: Get row item
Message: 21;17 is not a valid value for Int32.
Exception Type: Exception

Why is the robot reading ‘21;17’, instead of just the single one value ‘21’ of column 1, row 1?

Thank you in advance for your help.


#2

Hi @dgotsi,
Which lesson you have this ?

Check the Delimiter

Regards
Balamurugan


#3

Hi Balamurugan,

Many thanks, I changed the Delimiter to ‘Semicolon’, and like this it worked, I would not have figured that out on my own.

Now the process runs through the 5-row CSV file and looks good, but when it reaches the last row (row 6 in Excel, 5th row of values), I get the exception error that ’ Index was out of range. Check that the collection has values and the index is less than the size of the collection’ . And that ‘Get row item: There is no row at position 5.’

The condition in the counter Decision activity is ‘counter < 6’, and counter increases by 1 each time. Would you know what is wrong here?

I’m on the very first video of ‘Level 1 - Foundation Training’


#4

Hi @dgotsi,
Normally the row index starts with 0 and ends with total rows.count-1.

So in the Decision activity better can apply the condition like counter < datatable.rows.count. you will not get the error. Below I have attached an example to get clear idea. But you have many ways to get value from excel. In further lessons you will learn it. Best wishes to clear the exam.

File : New.zip (2.1 KB)

Regards
Balamurugan


#5

Thank you very much Balamurugan, that solved the issue!


#6

WelCome @dgotsi

Regards
Balamurugan