If your Collection is Distinct
Then Inside forEach
You can use intCurrIndex= ListVariable.IndexOf(item)
Suppose if your Collection is not Distinct
Then Create one Counter Let us take intindex and initially assign 0
Then use intCurrIndex=intindex
After that Increment it by one intindex=intindex+1
If I need the index of an element in a ForEach I usually change my foreach to run over an array of indexes in the list and assign the element inside the loop.