Sometimes we need to get iteration index in Foreach loop for data processing, one resolution is to set the "Concurrency Control" to 1 and use a variable as index which always be added by 1 for each iteration.
This approach can achieve what we would like to have, but it will impact the performance since the foreach is in sequential mode.
In order to keep the "Foreach" action running in parallel, there's a new approach as following:
1. Generate a new array which save the all the index of the original array which need to be processed. For example, if we have a 10 items array, then the index array need to be generated as [ 0, 1, 2 ... 9 ] (start from 0, end with [array length - 1] ).