For each row repeating top row over and over, not moving to lower rows

Hi all, I am new to UiPath so I am hoping this is an easy fix. I am trying to take data from a google sheet and extract it into the appropriate boxes/forms in a specific website. I have written the for each loop and it is looping the correct number of times, the problem is it is repeating the data from the top row over and over again instead of pulling data from the subsequent row for each loop. I am assuming that my variable is wrong - I have attached a screenshot below. Any help would be greatly appreciated!

If the ‘For Each Row’ loop in your UiPath process is not moving to the next row and keeps processing the top row over and over, here’s what you should check to fix the problem:

  1. Variable Scope: Ensure that any variable you use to store data from the Google Sheet is not being reset with every iteration of the loop. The variable should be updated with data from the current row in each loop.
  2. Dynamic Data Extraction: When extracting data from the Google Sheet to enter into the website, make sure you are using the current row’s data. Inside the loop, you should refer to the data with something like CurrentRow("ColumnName") or CurrentRow(0) if you are using index numbers. Don’t use a fixed cell reference.
  3. Correct Activity Configuration: Double-check that the activities inside your loop are configured to use the data from the ‘CurrentRow’ variable and not a static reference.
  4. Check the Range in Read Range: If you have specified a range in the ‘Read Range’ activity, make sure it’s not just the first row. To read the entire sheet, you can leave the range field blank.
  5. Ensure the ‘For Each Row’ is Correct: The ‘For Each Row’ loop should automatically go to the next row after each iteration without any additional configuration. If it’s not, there might be a problem with how the loop is set up.

Try going through these checks step by step, and you should be able to find where the problem is and fix it.

Hi,

In general, it’s unnecessary to use both ReadRange and ForEachRowInSpreadSheet.
If you want to use ForEachRowInSpreadSheet, can you try to use CurrentRow ?

Or try ReadRange and ForEachRowInDataTable as the following?

Regards,

Hi @kaitlyn.f1

When you click on Use Variable in Type Into , you will get For Each Row in Spreadsheet,. If you scroll down below CurrentRowIndex you can find the column names that you have in excel, you can use that directly. You need not click on CurrentRow.


Or else if you click on the dots in the right hand side of the text box you can find Open expression editor, from there you can type CurrentRow("your column name").ToString and click Save. This will also work. Make sure you type the correct column name or copy paste the column name from your spreadsheet.


Regards

1 Like