How to get the current index of the List in a loop? | WebMethods

There is a special variable on the pipeline called $iteration which will be incremented as the loop operator works up through the list.