Hi,
I guess I would like to do something similar as described here: https://powerusers.microsoft.com/t5/Building-Flows/Can-I-get-index-number-in-apply-to-each/m-p/46543...
I have an array, here as an example a very simple one and I do a for each over this array.
I would like (or should have) the index of the for each. No clue why the first array value has 3 as incremented variable. It seams the for each are not in order of the array, can that be?
How do I get the real/correct for each index (here in this example it would be "1")?
Thanks,
Stefan
Solved! Go to Solution.
Good catch. I was under wrong impression that you did not enable Concurrency. Good to see you the issue is resolved.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @cgru3eejc2 ,
Are you using Loop inside loop (for each) to iterate over each array and each item inside that array ? If so you have to clear out the value at the first step before going to inner for each loop. This way you get the right value inside that inner loop.
Thanks
You cannot increment variable value while setting it.
Place a compose action before Set Variable. Insert the expression for increment of the variable in the compose action.
Now, Set Variable to the output of the above Compose action.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @ManishJain and @rsaikrishna
Thanks for your messages.
It's the only "loop" (for each). The increment on it's own counts up fine, so this is also not the problem.
I guess I found it - the for each is using parallelism (of course)...
I now changed the "Concurrency Control" in the for each settings to 1 and with that the for each index is equal to the variable which increments with each for each item loop.
Hi @cgru3eejc2 ,
If you have used concurrency control you have go with @rsaikrishna method.
If it resolves your issue please mark the solution as accepted.
Thanks
Good catch. I was under wrong impression that you did not enable Concurrency. Good to see you the issue is resolved.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
128 | |
53 | |
38 | |
26 | |
21 |