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,
Susana

2 Likes

Following steps you need to follow:
1.Open browser
2.in 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©.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:

Hello!

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.

Regards,

1 Like

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

2 Likes

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

:grinning:

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