Hi,
I am iterating through a JSON response and executing a chain of services after each iteration. After executing the services, I want to be able to know where I was in the JSON when I triggered the service. So for example, for the second iteration of the JSON, I want to know upon success of the execution of the services, that the response is for the second iteration. I tried using LocalStorage in my iteration (i.e.for loop) to keep track of a variable “count” (so that I could know where in the for loop I am). I could then get this variable after success of the services. However, it seems like there is a sync issue, whereby the loop runs to completion before the services are executed, and so I am only picking up the last iteration using localStorage.
How would I go about keeping track of my location in the iteration? Is there a way for me to send that information through the service? (i.e. get the iteration number as a response parameter?)
Thank you for your help!
Homan