Hmm, it has been forever since i touched this code.
but just did a quick test, i see only “foreach data row” add’s the “Index” and “Total” variable on the activity scope. If i test those in foreach data row it seem to work, but if i re-create them manually in either foreach data row", “foreach” “do” and “loop” it either add’s to the value or reset them all to 0 … what a horrible thing i made there.
I have created a new buiild of OpenRPA that fixes that code. 1) it gets the right variable ( index or total and don’t care if only one is there ) 2) it actually does the update correctly ( i hope )
Now, back to you point.
Yes, you are right, the variables inside a sequence are reset doing each loop, since the scope is inside the body of the activity.
So you can either declare the index variable outside the looping activity and increment it yourself doing each loop, or you can update openrpa to 1.4.57.4 or never for anyone reading this in the future and use my “hijacking” of Index and Total and make sure scope is the activity, not the sequence inside the activity