I am trying extract information from object dynamically based on a {variableName} i.e. "Material Information 1", "Material Information 2" ... "Material Information {variableName}"
At the end of each loop, variableName will be variableName+1
The concurrent in 'Apply to Each' is registering the global variable {variableName} so some actions are affected by the variable.
Is there a possibility of having a local variable to the loop or anything close to a local variable?
so that when we are performing any action on it, it would execute properly on each input in apply to each.
@Jhmiah- If all you need is an iteration variable that increments by one after every iteration, you can use iterationIndexes. Along with concurrency of 20, it will give you better performance.
Ah, I see what you mean now. Yeah, in that case you have two choices for handling this:
Thanks for the reply. However, I believe that when we set variable, it is changing the global variable which will interfere with the other concurrent operations.
i.e.
lets say there are n=50 concurrency, inside Apply to each (n=1), there is a 'Do Until' that references x(x=1). At the end of 'Do Until', there will be a increment variable (x=x+1), so NOW x=2.
because of latency, lets say n=14 is running later, inside apply to each (n=1), it is using the global variable x=2 that was set by ApplyToEach(n=1). Therefore it skipped n=1.
Is this a limitation in Power Automate?
In PowerAutomate, You can only declare variables outside loops, but then you can manipulate them within the loop. So just add an "Initialize a Variable" step outside your loop to create the var, then handle its value inside the loop, including a value initialization at the start of each loop and it will operate just as though it was declared within the loop. Something like:
WarrenBelz
55
Most Valuable Professional
mmbr1606
42
Super User 2025 Season 1
Michael E. Gernaey
31
Super User 2025 Season 1