DataTable iteration displays different output order comparing to xls file

datatable
excel
studio

#1

Hello everyone,

I am currently developing an automation which reads an excel file and then passes each row of the excel file into a website.
The excel file contains on top 3000 rows ( i believe this is relevant).

Scenario:

When I iterate through the data table it seems that it does not respect the excel file order.
I encounter multiple situations when it starts with row 1 and then jumps to record 2000 then to record 500…and so on. There is no filter applied and the Add Headers option is checked in the read range block.

Why is this an issue you might be wondering? I am dealing with a big number of records and hence there might be runtime unexpected errors which I am not aware of the automation will crash. This will require me to update the table from the last know entered value in the web application -> delete the added rows from xls -> restart the robot.

Steps to reproduce:

Excel application Scope
read range -> output DataTable
for each row in DT
try
assign to value
attach browser
Type Into
catch ( SelectorNotFound exception)

Expected Behavior: Iterate through each row as displayed in the xls file.

Thanks for the help,

   Victor

#2

@Gabriel_Tatu


#3

anyone?


#4

We have to investigate. Does this happen if your range is smaller, like 10 rows and 5 columns?


#5

Hi Gabriel,

I am sorryfor such a long replay time. Well from my research on smaller ranges this dose not happen.
To be more specific i have tried with a variety of different ranges from 10 to 400. All of those posed no issues in the iteration.
This issue seems to appear from 1000+ range. Although i have never tested for such range. My minim error encounter range was between 3000- 8000.
My excel file was containing table with headers from columns A to F with 8000 data entries.
Maybe you could reproduce this case.
I had a mix of numerical( phone number) and text values( first name, l name , e-mail etc values in the columns). A proper column example will be f Name, l Name, e-mail, phonNo , rank , position.

Some points to take into consideration:

  1. maybe the complexity inside the for each loop is to big ( my loop contain, browser navigation, assign values, click events, write text, selectors)
  2. The error dose not seem to be generated by the read range because i tried displaying all the data inside a message box after the read range activity and everything was in the right order.

My best guess is to investigate the Data Table variable maybe the indexing becomes confused due to the big volume of entries. This issue being triggered by the data table iteration. If i remember right it starts with the first record but then jumps randomly.(i could not identify a pattern).

So much info provided. Hope this helps :smile:


#6

Hi,

My first instinct tells me you have a coding error, but who knows with technology haha.

Since you have steps inside a Try/Catch, is it possible that some of them are throwing errors therefore skipping those rows? You can test this with a generic Exception in the Catch and Rethrow in the Catches.

I would also avoid running through thousands of iterations in a ForEach when possible. Just from what I’ve seen it can run your memory high.

Good Luck!


#7

Hey Clayton,

Haha thx for the input. Yes you might be right with the code error but I have that already covered. Been experiencing with both generic and specific exceptions and there is no track of that. There are some selector error generated due to fail of identification on web elements in browser but it’s fixed as being a controlled error. It works such as if an select element is not found -> log the specific item in a text file -> proceed to next item. And that is fine for my present scenario.

Unfortunately i do not agree with you on the number part. thousands of iteration is a small number. A 8 gb Ram with an i3 processor which is basic our days could easy handle this. Not to mention a server which has way much computing power.
8000 is nothing if you ask me. Yes it might take some time.
In my case an item loop takes about 45-55 seconds. ( maybe this should be taken into consideration)

Cheers :wink:


#8

I agree, 8000 is not much and should handle it with your memory specs. However, let me clarify, because I was specifically talking about UiPath’s (and other RPA software’s) functionality around the speed of looping and its use of java.exe which climbs the longer a process runs. It’s something I believe needs improvement for sure, since I can do most tasks that UiPath does using vb scripting and it’s much faster and more reliable in many cases; the kind of speed I hope RPA step/activity design can get to eventually. :slight_smile:

Thanks.