# Loops skip result if undefined

**URL:** https://forums.losant.com/t/loops-skip-result-if-undefined/5311
**Category:** Help
**Tags:** workflow, loop-node
**Created:** [October 24, 2023, 10:12pm UTC](https://forums.losant.com/t/loops-skip-result-if-undefined/5311 "2023-10-24T22:12:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Wesley\_Manning](https://avatars.discourse-cdn.com/v4/letter/w/ba8739/32.png) [@Wesley\_Manning](https://forums.losant.com/u/Wesley_Manning)
#### Post date: [October 24, 2023, 10:12pm UTC](https://forums.losant.com/t/loops-skip-result-if-undefined/5311/1 "2023-10-24T22:12:32Z")

</div>

I have a parallel loop where I’m using the “Iteration Result Path” to add to the loop array.

Is there a way to tell an iteration not to store a value to the final loop array? Some of my iterations I don’t want to store anything that iteration.

I thought passing null might prevent anything being added that iteration but no, I’m just getting a lot of “undefined” in the final array as null is being passed to the return node.

In my case I don’t think I need the performance of the parallel loop so I will try the serial version.

---

<div class="post-metadata">

### Author: ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)
#### Post date: [October 24, 2023, 10:22pm UTC](https://forums.losant.com/t/loops-skip-result-if-undefined/5311/2 "2023-10-24T22:22:57Z")

</div>

One solution is to use the Array Node’s [Compact](https://docs.losant.com/workflows/logic/array/#compact) operation after the loop. Compact removes all falsy items from the array, which includes `null` and `undefined`.

---

<div class="post-metadata">

### Author: ![Wesley\_Manning](https://avatars.discourse-cdn.com/v4/letter/w/ba8739/32.png) [@Wesley\_Manning](https://forums.losant.com/u/Wesley_Manning)
#### Post date: [October 24, 2023, 10:30pm UTC](https://forums.losant.com/t/loops-skip-result-if-undefined/5311/3 "2023-10-24T22:30:42Z")

</div>

Thanks will do that. I realize after it’s not limited to parallel loops.
