Skip to main content
Solved

Looping 2 Columns in excel


Forum|alt.badge.img+1

I have a spreadsheet with several columns, I want to Read Column A (Order Number)
I need to take that Order Number and lookup it in our ERP (In web Browser)
Then I need to Read Column B (Order Charge) and paste that value in a box on the ERP within that order

After I need it to loop through all of the records within the Spreadsheet. 

The bot will loop through either the Order Number or Order Charge but not both, any suggestions?

Best answer by MaggieW103794

Use CSV open / read and assign to data table / close

then loop in data table and assign variables to a record variable, assign however many fields you need by column index, then perform actions. Like this

 

Also, be wary of using mouse clicks. you’re counting on it to click the exact same spot but elements can move depending on the site, window size, and resolution

View original
Did this topic help answer your question?

8 replies

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+16
  • Most Valuable Pathfinder
  • 3276 replies
  • June 6, 2023

Hi @jbarretto ,

The bot will loop through either the Order Number or Order Charge but not both, any suggestions?

If both fields contains the data (Order Number or Order Charge), you can loop the any one of the field. or If not contains data, you can use if conditions check the field value empty or not then loop the value field and move further.


Padmakumar
Forum|alt.badge.img+14
  • Flight Specialist | Tier 4
  • 786 replies
  • June 6, 2023

Hi @jbarretto ,

 

For better understanding, could you please share the snapshot of the loops ?


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 3 replies
  • June 6, 2023

 


Forum|alt.badge.img+7
  • Navigator | Tier 3
  • 30 replies
  • Answer
  • June 6, 2023

Use CSV open / read and assign to data table / close

then loop in data table and assign variables to a record variable, assign however many fields you need by column index, then perform actions. Like this

 

Also, be wary of using mouse clicks. you’re counting on it to click the exact same spot but elements can move depending on the site, window size, and resolution


Padmakumar
Forum|alt.badge.img+14
  • Flight Specialist | Tier 4
  • 786 replies
  • June 7, 2023
jbarretto wrote:

 

 

I can see that you are using the List items to iterates through and also two list actions disabled before starting the loop. Are you sure that the Bot going inside your loop? 

If you are handling with Excel, you can use Loop → For Each row in Worksheet either from Excel Basic or Advanced (depending on the availability of Excel installed on your PC).

 

 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 3 replies
  • June 7, 2023
MaggieW103794 wrote:

Use CSV open / read and assign to data table / close

then loop in data table and assign variables to a record variable, assign however many fields you need by column index, then perform actions. Like this

 

Also, be wary of using mouse clicks. you’re counting on it to click the exact same spot but elements can move depending on the site, window size, and resolution

This was very helpful thank You!, Just curious could you share how you have you loops setup? Also do i have to specify the table size in the variable Below. 

Using your setup i have it returning the values in a message box, but it still wont loop, I’m sure I’m doing something wrong just not sure what. 
 

 


Forum|alt.badge.img+7
  • Navigator | Tier 3
  • 30 replies
  • June 7, 2023

@jbarretto  you’ve got the loop set up right and you are putting the row values into a record variable, which is correct. But your variable assignment is wrong. What you are saying is to return a very specific cell in the table, by referencing the table and column and row indexes. You need to reference your row variable and the column index you want. So, should look like: TableRow[0] to return value of the cell in column A. Then on the next iteration it goes to the next row, so forth, until the loop is broken.


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 3 replies
  • June 7, 2023
MaggieW103794 wrote:

@jbarretto  you’ve got the loop set up right and you are putting the row values into a record variable, which is correct. But your variable assignment is wrong. What you are saying is to return a very specific cell in the table, by referencing the table and column and row indexes. You need to reference your row variable and the column index you want. So, should look like: TableRow[0] to return value of the cell in column A. Then on the next iteration it goes to the next row, so forth, until the loop is broken.

This worked! I really really appreciate you and everyone else here taking the time to help me with this. Thank You!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings