How to exit out of the do while loop

I am using a do-while loop and using a “true” as a condition.

I also tried to pass a boolean variable to the condition but not able to exit

You need to chance to false the condition by a variable, I mean, the same variable need to change when I need to exit

You don’t have to pass a boolean variable. You can use any expression that returns a boolean value, like ‘myVar = “hello”’ - when myVar doesn’t equal hello it’ll exit the loop. What is your loop doing?

Hey @Sami_Rajput ,

Please refer below thread

Hope it helps you out

@Sami_Rajput - You can also look into Break/Exit Loop activities if that is what you need: https://docs.uipath.com/activities/other/latest/workflow/break

image

This allows you to exit a loop from inside the loop.

1 Like

@Sami_Rajput

break should break the do while loop as well

if not via condition we can make it break

example…you can see that log is printed only ocne

cheers