Applies to Product- Power Automate
What’s happening?
Using variables in concurrency loops can result in incorrect values.
Reason:
The underlying cause of this is related to the use of variables within a concurrency loop. In scenarios where concurrency is enabled, variables are shared across all concurrent iterations of the loop, leading to unpredictable results due to simultaneous access and modification by multiple threads. This resembles a multi-threading scenario where the execution order can affect the final output.
Resolution:
- It is recommended to avoid initializing variables inside a concurrency loop to reduce the chances of incorrect behavior.
- Instead of using variables, utilize the compose action within the same thread/loop to preserve the context and ensure that the values do not change unexpectedly.
