How to do data entry running through rows batch by batch?

I’m trying to get the robot to run through all the rows in the excel and enter the details in a website 10 names by 10 names. I can do a variable.Rows(0)(“Name”).ToString up to a certain number but the list of names I receive somewhere can be unknown. Do I do a loop if so, how to get the robot to read the 11th row after completing the first batch of 10 rows for example?

Many thanks for the help in advising this.

Keep a counter and count after every time it loops. Then make a decision once it reaches 10.

1 Like

How to bring in a counter?

Use linq query to get 10-10 records from batch file-
To take 10 rows-
first run-
var topRows = table.AsEnumerable().Skip(0).Take(10).ToList();

second run,
var topRows = table.AsEnumerable().Skip(10).Take(10).ToList();

Third run,
var topRows = table.AsEnumerable().Skip(10).Take(10).ToList();

I have replicated the same in the workflow- Get10Rows.xaml (15.6 KB)

Hope this will be helpful! Please let me know if this is not what you are looking for :slight_smile:


Hi, thanks for the workflow. I’m not sure how this applies to the data entry. I had prepared a sample excel data attached. random.xlsx (13.5 KB)
If let’s say, I want to do data entry 10 by 10 names using column B only and submit, how do I have a counter to submit? I can do #1 to #10 but I can’t do it for #11 onward. I tried to apply “For Each” but it will still loop back to #1 after the 10th is done. I’m pretty much stuck. I just started picking up. Will you be able to show me some guidance? Thank you so much.

I tested you input file. The workflow attached in my previous response is working absolutely correct.I guess… After for each activity, you haven’t connected the next step that is written.

Hi, don’t I need to have uipath read the excel file I have before for each activity? Where do I input the read file in the workflow? I’m pretty lost and thank you for the patience.

image How should I input the blanks in this case

You can read excel file in your main workflow and pass the datatable as argument to this workflow. Else you can add reading of excel as beginning step in this workflow itself.

The list generated in the previous step of foreach will be the input for foreach (blank field)

Hi, I had replaced “inDtBatchData” to “list” and the assign activities after reading the file and set the output as “list” variable.
If I add “list.ToString” the error goes off and I get the log message “All record retrieved” in the log message. But it doesn’t do data entry in the website. What am I missing here?
Thank you so much for guiding me.

What the error says?

I will get this
if I use this:image

Please send your workflow.

Hi, please see the attached workflow.Get10Rows.xaml (24.1 KB)
As the site I’m using is private, I won’t be able to share. I’m using the registration for uipath site as a sample instead. Where did I go wrong? Thanks a lot for the help.

Can you please write logs or run the BOT in debug mode and tell me which activity is giving this error?

The excel values you read, you are assigning to a datatable variable “inDtBatchdata” and you are not using that any where. Instead you created a new variable of type datatable “list” which you haven’t assigned and using that as input to the loop.
The variable that you are assigning before foreach loop is different than what you are providing as input to the foreach loop.

The workflow i have given had complete solution. Only thing required there was assigning the input data to that workflow and logic what you were supposed to inside for each loop.
Can you please check the workflow again and correct these.

I had updated the list to “inDTBatchdata” and hopefully I have not missed out anything. There is no error encountered when I run the workflow in debug mode. The workflow executed and closed without any error. I got a “12/12/2018 23:37:10 All records Retrieved”. I believe it could be “For Each” activity if any since the data entry doesn’t happen the way I want. It’s my inexperience with this.
I have attached the workflow again. Get10Rows.xaml (24.0 KB)

Thank you so much for the time and guidance.


I am facing attached issue during execution