Is there a way to immediately exit out of a while loop?

Hey guys I’ve been wanting a function that doesn’t seem to currently be avialable and that is the ability to immedaitly exit out of a while loop. So lets say a while loop has 10 activities it in and I want to have an if statement on the 3rd activity that can cause the loop to exit out without running the remaining 7.

Both the while and Do while seem to have to finish running to the end of the current rendition, the only work around I’ve found is having the entire group of activities within a if statement within the while loop.

Is there a better way to do this?


We can use While activity which can be exit loop by Break activity, if use UiPath.System.Activities Package 20.4. If you want to use this while and break activities, you need to replace to new while activity because it’s not compatible with previous one.

1 Like