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.
Solved! Go to Solution.
Ah, I see what you mean now. Yeah, in that case you have two choices for handling this:
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:
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?
Ah, I see what you mean now. Yeah, in that case you have two choices for handling this:
@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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
10 | |
8 | |
6 | |
4 | |
2 |