# Why Break/Continue activity not allow in While Loop?

**URL:** <https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773>\
**Category:** Studio\
**Tags:** question, system, activities\
**Created:** [February 27, 2020, 7:37am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773 "2020-02-27T07:37:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [February 27, 2020, 7:37am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/1 "2020-02-27T07:37:28Z")

</div>

Hello @Pablito @loginerror

Why **Break/Continue** activity not allow in **While Loop**?  
Studio allow only these activity to **For each loop**.  
I Suppose **Break/Continue** activity should allow in all Loop activity i.e While/Do While/Foreach.

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [February 27, 2020, 7:38am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/2 "2020-02-27T07:38:39Z")

</div>

@lakshman @Lahiru.Fernando @Jan_Brian_Despi guys what you think?

---

<div class="post-metadata">

**Author:** ![Jan\_Brian\_Despi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jan_brian_despi/32/535308_2.png) [@Jan\_Brian\_Despi](https://forum.uipath.com/u/Jan_Brian_Despi)\
**Post date:** [February 27, 2020, 7:45am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/3 "2020-02-27T07:45:34Z")

</div>

Logically, it is correct 😅

---

<div class="post-metadata">

**Author:** ![lakshman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lakshman/32/523490_2.png) [@lakshman](https://forum.uipath.com/u/lakshman)\
**Post date:** [February 27, 2020, 8:49am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/4 "2020-02-27T08:49:02Z")

</div>

@sandeep13

No idea bro ☹

Actually these things will work in other programming languages but in UIPath its not working. May be someone from UIPath has to tell this why its not working here.

---

<div class="post-metadata">

**Author:** ![Lahiru.Fernando](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lahiru.fernando/32/523857_2.png) [@Lahiru.Fernando](https://forum.uipath.com/u/Lahiru.Fernando)\
**Post date:** [February 27, 2020, 8:53am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/5 "2020-02-27T08:53:13Z")

</div>

@sandeep13

I just did some reading on this…

Apparently, what they say is that for While, Do while loops, we can easily specify the stopping condition through the loop condition itself. However, for the other loop For Each, it does not have a place to specify a stopping condition and will loop until the end of the list unless we break it. This is the reason break/ continue activities are there for For Each and not for While, do while…

The other reason why coding can do and why uipath does not allow is because the workflow design standards are much different than the coding standards… Hence, things we do here is little different than actual coding

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [February 27, 2020, 10:27am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/6 "2020-02-27T10:27:24Z")

</div>

Okay @Lahiru.Fernando

---

<div class="post-metadata">

**Author:** ![nerlichman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nerlichman/32/523258_2.png) [@nerlichman](https://forum.uipath.com/u/nerlichman)\
**Post date:** [February 28, 2020, 9:34pm UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/7 "2020-02-28T21:34:03Z")

</div>

Hi @sandeep13!

As @Jan_Brian_Despi said it’s a logical matter.

Each type of loop in programming (While, Do While, For, For Each) has their own purpose and structure.

`For` and `For Each` have predefined how the iteration needs to flow and, when the `continue` method is triggered, the loop knows what to do next. However, `While` loops don’t have a predefined behavior, just a condition which indicates to continue (or stop) running the loop.

Regarding `break` method, `While` loops purpose is to run until a condition is met, so there shouldn’t be any reason to use a break method, you would just need to have a condition that meets your needs. In a `For` and `For Each` loop the problem is that there is no way to stop the loop until all the iterations finish. That’s why the `break` method was created, so we where able to prevent the loop to continue running when there is no need.

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [February 29, 2020, 12:09pm UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/8 "2020-02-29T12:09:48Z")

</div>

@nerlichman  
Thank you for explaining .got it

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [February 29, 2020, 1:08pm UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/11 "2020-02-29T13:08:07Z")

</div>

Closed on February 29, 2020, 1:08pm UTC



---

<div class="post-metadata">

**Author:** ![nerlichman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nerlichman/32/523258_2.png) [@nerlichman](https://forum.uipath.com/u/nerlichman)\
**Post date:** [March 2, 2020, 10:00pm UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/12 "2020-03-02T22:00:17Z")

</div>

Look what I found while looking components in the marketplace 😂

> **[While Loops with Break and Continue Activities - RPA Component | UiPath...](https://marketplace.uipath.com/listings/while-loops-with-break-and-continue-activities)**
>
> Using the Do While Loop or While Loop Activities, processes can now utilize While Break and While Continue activities to break out of a loop or continue with ...

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [March 3, 2020, 3:45am UTC](https://forum.uipath.com/t/why-break-continue-activity-not-allow-in-while-loop/197773/13 "2020-03-03T03:45:06Z")

</div>

modern problem required modern solutions 😂😂
