Yes the instructions weren't too clear.
I ended up not needing to use a pipeline in the while loop for this too.
Perquisites:
Create the three variables:
Iterations - set to 0
index - set to 0
count -set to 0
Instructions:
- I set the iterations variable outside of the while loop ( I determine the amounts of iterations I need by a lookup task):
- Set up an until loop, I use the following expression
@equals(variables('count'),variables('iterations')) - In this I didn't need to use a for each loop any more and created a look up in the until loop using the count variable as my offset. In your case you would probably input the pipeline that uses the foreach loop 5000 + records. In your foreach you loop pipeline you could create a count parameter and pass in the count variable value from the while loop pipeline. Then use the count parameter in your offset.
I plan to fetch 100 rows at a time so I multiply the 100 by the count variable(in your case count parameter). In your case you could probably do 5000 times the count variable
ORDER BY fieldname ASC OFFSET ',string(mul(100,int(variables('count')))),' ','ROWS FETCH NEXT 100 ROWS ONLY)a') - After activities in the while loop I set the index variable and increment it by 1
@ hide (add(int(variables('count')),1)) - Then I set the count variable the index variable (this is in the while loop)
I tried adding my screen shots but Microsoft is saying they're all too big for some reason.
Hope this helps!