Hello. I have a weird issue which I couldn’t help solve. Not even ChatGPT could help. I have a variable called BreakInterval of type Int32. I have assigned it a value of 1 for now for testing purposes. I have a For Each activity with type argument as String. In the Max Iterations field, I have set it to BreakInterval instead of manually typing in 1. The Assign activity is placed right above the For Each.
Results:
Manually typing: Only iterates a single time.
Using variable: Iterates infinitely without stopping.
Note: I have latest packages installed UIAutomation.Activities 23.10.3 and System.Activities 23.10.2. I even downgraded to previous version to see if its related to the packages and even restarted Studio, both had no effect. Any suggestions?
Make sure you only have BreakInterval created once (you can check by searching for it in universal search and seeing if it shows up twice with the ‘v’ icon). If you accidentally create a variable more than once in different scopes, you can get unexpected results like this.
remove duplicate variables (check if theres a yellow exclamation mark next to the variable)
if there are none and its still not working you can do this instead
create an index variable and use it in the index property in for each loop, inside the loop have an if statement with the condition index >= BreakInterval
Did what you mentioned, no errors or exaclamation warnings show. I’ve hit Ctrl F to find all the instances where this variable is located. It is present in three places.
In the variables panel.
In the multiple assign activity at the very top.
In the Max Iterations property field of the For Each loop.
I tried this out on Studio 2023.10.0 and was able to reproduce it with various versions of UiPath.System.Activities → To me it seems indeed like a bug.
I already told you in the previous post that I did what you mentioned. It did not work. Pretty sure its not a duplicate issue. Is it possible to be a bug? I usually solve 99.9% of all problems, but this, its just simply weird.