For each loop for collum


#1

Hi Guys,

I have a question regarding an excel file which i would like to automate. I have an excel file containing several employees first names and last names. I would like to only select the data from the collumn containing the last names and by using a for each loop, input that name in a website (by doing so for every employee). However, when i try this the function doesnt loop and the bot only seems to read the last cell name (and not the entire collum). I am obviously doing something wrong here (considering i am a rookie) but i would like to learn:)… i have attached two printscreens with my workflow. Could somebody please assist me?

Kind regards,

Matthew snip%202


#2

Hi there.

To fix your problem, place your Open Browser sequence inside the other For each.
It should read:

For each row in dt1
    Assign goaID = row.Item("EMPLOY.....
    Open Browser
        Type Into // use goaID which is the id I assume you want to use.

So ultimately, you want to loop through each row in your datatable, then use row.Item() to process each employee name as intended. (you can remove the other For each)

I hope this helps you.

Regards.


#3

@Matthewvz check attached link after downloading change excel path and remove open browser,attach browser and inside for each row there is get row item in the property change column name to last name so you can get last name values