Code optimize

hi all

i am having huge amount of data in excel , took it to DT, now inside the for each loop, i have written too much code.

how to break the code??
but again i have to come back to for each loop? Or is there any other way to do so.
Becoming difficult to debug


code has many if conditions boz of for each i m not understandin how to do

1 Like

Hi @Seem

In order to understand how to separate the processing I need to know what type of things you are doing in the for each row loop can you explain what happens in it so it gives us a clear picture on how to address it

it opens the website enters the values , closes the web site angain goes n opens the web site - it repeats.

all scraped data it processes and i have to add the data to the same row in diff columns

So for each record in the data table, you are opening and closing a web page? Are these different web pages that you open for each record or is it the same web page?

yess

Fine
to do this we can have any specific IF condition that if gives true value will go for THEN part where we can use a activity called BREAK which will abruptly break the for each row loop and goes to the next activity to that of for each row loop along the sequence
–but we need a valid condition to be used to get out

and for this

usually this for each row loop will iterate through each row one by one until the last row in the datatable
–here we have used if condition, so if its true it will go to THEN part where all the process will be executed and once it gets over it will come back again to the next row along the iteration and the same process will be executed again but for the next data (from next row)
so i hope we dont need to use BREAK activity out here, unless we want to abruptly close the for each row loop iteration and continue along the sequence with remaining activities

hope this would help you
Cheers @Seem

Okay… have you thought about getting that web page open and close part out of the loop? So you open the web page once, then enters the loop, do the processing then gets out of the loop and close the page…?

I think that can be one improvement