For each row issue

Hi all,
I am using for each row inside excel application to read data and paste it in web page…
my concern is I have to add open browser inside ‘for each row’ so while running its open numbers of session browser equal rows number…

when trying to drag the open browser out the loop, there is var row will be undefined
so couldn’t call the var row(0).Tostring…

Can anyone advise here!! :frowning:

my wf SPR devices.xaml (27.1 KB)

I tried to change the scope for var to Do or Sequence , but Im getting error

The life of row object is limited to the for each loop, you can refer row out side for each.

You can follow the below logic

  1. Open the website
  2. For each loop
    2.1 Place the values
    2.2 Any other action
  3. Close the browser

but I need to use the var which declared in ‘get row item’
I followed the logic but still

any suggestions??

Hello @Hanan_Saad,
You can open the browser outside the loop and then use navigate activity inside the loop

Best Regards,


Following steps you need to follow:
1.Open browser Do of open browser use ‘Excel scope application activity’
3.Read Range and store into data table
4.Use for each row
5.Assign variable to row.item(“Column name”)
6.Enter variable in input box of browser.

I think issue is with the syntax - row(2).Tostring

The correct syntax is - row.item(c).ToString // C - column index starting from zero

Hi @Sandeep_3 ,

Can you explain point 5 & 6 , row.item(“column name”) will mention column name""or column index??
and how can assign input to open browser??

Please find below attach snapshot

appreciate your help

Yeah but how will declare C var and how will be increased??

You can mention the column name or column index…example row.item(“test”).toString.
and store this in one string variable and pass to the browser input field.

1 Like

good but how can I pass var to the browser?
there is only URL can pass… and thank you for your quick reply :slight_smile:


Have you tried something like this?

SPR devices.xaml (26.2 KB)

It’s a bit hard to understand what you want to do, but I think the workaround may be something like this.


1 Like

You should pass varible here inside are using for loop so it will automaticaly increment.


Hi @Lucas.Pimenta , thanks for your help
I am getting still same issue, the the assigned var ’ Value’ will be not defined outside loop… :frowning:

Thanks its working… :slight_smile:

1 Like


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