"For Each" Logic - Read Spreadsheet and Type into Application?

Hi all,

I’m trying to figure out the best approach to automate the following scenario. I have a spreadsheet with two columns (A & B), and each number is considered an item number. I load column A into an online e-commerce application. I then click on each item from column A, and associate the numbers in column B to correct item in column A.


For example, I can have the bot click on the first item from column A, but how do I tell it to type into this box the numbers in column B for that item? And then continue going down the list and doing the same thing?

I think I only need help with the for each logic?


Can you please explain the scenario a bit clear please.
For each item of column A you want to enter corresponding column B numbers into an application?

@Sriharisai_Vasi Yes that is correct. So I click the populated item from column A in the application and I’m brought to the screen with highlight above. I need the bot to enter the corresponding numbers from column B into that text field. Let me know if you need more info!

Considering you have already updated data on Web page

1.Excel scope
Read Range (create Data table as “DT_Excel”)

2.For Each row
A.Read value of column A and assign a veriable for that say “VarA”
B.Read value of column B and assign a veriable for that say “VarB”
(You might want to record below steps and then pass the variable “VarB” by editing selector- opening and closing application in for each will degrade the performance)
a.Open Web page
b.Find Element “VarA” and click on it
c.assuming it opens type into to change activity and pass the VarB into it
d.Close the web page
if you can share sample web page example i would like to share xaml

1 Like

Please indicate your selectors in the below xaml and try it.

test.xaml (8.9 KB)


Thank you - I will try this out and report back!

Thanks! I will take a look at this today and try my selectors.

@Meera_Mahajan this helped a lot - thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.