# ForEachLoop should warn of no connection

**URL:** <https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409>\
**Category:** Blueprint\
**Tags:** UX, foreachloop, warning, usability, unreal-engine, question, Blueprint\
**Created:** [September 8, 2015, 2:13am UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409 "2015-09-08T02:13:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fbe5155f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fbe5155f](https://forums.unrealengine.com/u/anonymous_user_fbe5155f)\
**Post date:** [September 8, 2015, 2:13am UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409/1 "2015-09-08T02:13:17Z")

</div>

The blueprint compiler now warns of nodes pins that don’t return with a blue NOTE indicator. That’s great.

I think a **ForEachLoop should also warn via NOTE if there is no array connected.**

_After refactoring, it’s quite common that the blueprint editor will simply disconnect nodes and not say anything_… and something that used to work just doesn’t. And it’s not trivial to work out why. It should be blatently obvious that a foreach has no collection connected to loop through and the blueprint editor should warn the user! To me it’s a **UX issue.**

You would never want a ForEachLoop with no array connected, it means that everything in the body would never trigger. it looks innocent yet it’s a pretty big problem.

![57615-grr1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/5/7a5a35b4009c7183c80dbaee79b1774bf1b7d071.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [September 8, 2015, 8:31pm UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409/2 "2015-09-08T20:31:56Z")

</div>

Hi ,

I have not been able to reproduce this on my end. When I create a foreachloop, I receive an error until an array is plugged into the target pin. What steps did you take to reproduce this on your end. Does this occur in a clean, blank project with no additional content or is this limited to one project?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fbe5155f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fbe5155f](https://forums.unrealengine.com/u/anonymous_user_fbe5155f)\
**Post date:** [September 8, 2015, 10:28pm UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409/3 "2015-09-08T22:28:19Z")

</div>

Thanks ,

Try a typed array variable, drag off it, create a foreach from the array dragged out, then later, change the type of the array. Array will be disconnected and compile silently.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [September 9, 2015, 6:41pm UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409/4 "2015-09-09T18:41:44Z")

</div>

Hi ,

I’ve added a feature request, UE-20904, to be taken into consideration by the development staff for a warning on foreachloop and foreachloopwithbreak nodes to let developers know when no array is connected.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fbe5155f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fbe5155f](https://forums.unrealengine.com/u/anonymous_user_fbe5155f)\
**Post date:** [September 9, 2015, 11:05pm UTC](https://forums.unrealengine.com/t/foreachloop-should-warn-of-no-connection/331409/5 "2015-09-09T23:05:26Z")

</div>

thanks
