Reading data from the next row in an excel after completing a loop

I’m running a process but I cannot get it to read from the next row in an excel. Here is what the process does:

  1. Using the first row, it enters in information from each column into an online application.
  2. Once it is done, it submits that application.
  3. Then, I need it to do the same thing for the next row, but it keeps reading row one.

This is a copy of my process:
Citizens Bot Project.xaml (178.6 KB)

Hi @Adams_Zoe_J,

You needed a loop to loop through all the rows in the excel. I have modified the Xaml. The noOfRows in excel is hard coded for now(=10) . Try to replace it with actual no of rows in the excel file.

Citizens Bot Project.xaml (155.6 KB)

1 Like

I suggest using For Each Row activity in your workflow which means for each row you have in your excel file, it will do the process you want until the end of the file.

1 Like

It loops, but the second time it goes through, it just reads row one again instead of going to row two.

For the For Each Row, it also loops, but the second time it goes through, it just reads row one again instead of going to row two.

Everyone has been recommending For Each Row, but it doesn’t seem to work.

@Adams_Zoe_J

Your doing something like this, now?

  • ReadRange (Workbook) WorkbookDataTable (DataTable)
    AddHeader = True
    Range = “” (empty string)

  • Open browser and authenticate

  • ForEachRow row in WorkbookDataTable

    • Fill The form with this DataRow’s values
    • Submit the form
  • Logout and close browser

If your Excel worksheet has Header, you can use the following form to obtain the value in “Name” column:

row("Name).ToString

otherwise, you can reach it by the index (first column starts at 0)

Would you mind showing me what that looks like. That sounds a bit different than what other people are telling me to do, but I want to see it to make sure I’m doing it right if you don’t mind.

Here are screenshots and a sample

Be careful when you search for Read Range activity as you have two flavors: I prefer Workbook vs Excel

ForEachRow_Example.xaml (8.8 KB)

Unfortunately, none of the suggestions so far have worked. The process continues to type the information from row one.

As the solution was given by @msan, it should’ve worked.

I keep playing with it, but it does not seem to be working. I’m going to try a loophole instead. Less effective, but I can’t figure out how to get it to work. It loops, but does not go to the next row.

Hi Adams

Please check this video and try to figure out.

In the video she’s using a csv file because of that The only difference that you have to do is just

1- Set an excel application scope
2- Read Range after the excel application scope
3- While you selected Read Range activity set a variable to create a data table in the Output section.

After you create the data table

1- drag a new sequence in your flow chart
2- Drag an Open Browser activity inside the sequence
3 In the Do Section drag a For Each Row activity and Valuable Expression is gonna be the name of the data table
4- In the “Type into section” write like this
row(“Name”).ToString Whatever you wrote the column name just change that. It must be exactly the same.

It will loop till the end of excel file.

I hope this would be helpful. :slight_smile:

Regards.

In your file, you were reading the same cells at each iteration (here, cell B2) as it is hard coded and not something like "B" & rowNumber

Could you please attach a copy of the change you made?

image