Using Nested Loop , Inner counter loop value should remains same after each iteration

Hi,

In my Program there are two loops running . One is reading excel files from folder and second loop is read excel data and put it into webtable.
so after execution of first excel file counter2,counter3 value remains same (e.g: after reading rows counter2 value is 30).
I want counter2,counter3 value set to 0 and counter value remains same after each iteration. can anyone help?

Foreach item in arrayFiles{
counter=counter+1
[Read Multiple excels from folder]

Foreach row in Datatable{
counter2=counter2+2
counter3= counter3+4
ā€¦
}
click ok option
}

Hi @chiranjit.saha1

You can simply reinitialize the variables just before the datatable for loop.

Foreach item in arrayFiles{
counter=counter+1
[Read Multiple excels from folder]
ā†’ counter2 = 0
ā†’ counter3 = 0

Foreach row in Datatable{
counter2=counter2+2
counter3= counter3+4
ā€¦
}
click ok option
}

1 Like

Thanks.

1 Like

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