# Issue with If/Else and List.DropItems

**URL:** <https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341>\
**Category:** DesignScript\
**Created:** [January 15, 2021, 6:53pm UTC](https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341 "2021-01-15T18:53:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [January 15, 2021, 6:53pm UTC](https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341/1 "2021-01-15T18:53:59Z")

</div>

See attached GIF. Does anyone know what is going on here? The “true” branch (_List.DropItems_) is being executed no matter what the input is. This is driving me crazy!

![IfElse](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/9/8902433836122a9057e568ddc403420adfb1c0ad.gif)

---

<div class="post-metadata">

**Author:** ![Robert\_Younger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/robert_younger/32/205603_2.png) [@Robert\_Younger](https://forum.dynamobim.com/u/Robert_Younger)\
**Post date:** [January 15, 2021, 7:26pm UTC](https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341/2 "2021-01-15T19:26:07Z")

</div>

It looks like false is _almost_ executing as intended; the problem is that the output seems to cut to the smaller list size (4 elements) between the two options.

EDIT: [here’s an old conversation on the topic, contains a solution](https://forum.dynamobim.com/t/if-statement-output/8134/2)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [January 15, 2021, 7:29pm UTC](https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341/3 "2021-01-15T19:29:35Z")

</div>

> [@zachri.jensen](#):
>
> The “true” branch ( _List.DropItems_ ) is being executed no matter what the input is.

In this case and with the _If_ node, the length of the result is always truncated to the count of the _shorter_ option

![condition](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/1/21a37b0358e6423294846719241ff03b3b5face8.gif)

[condition.dyn](https://forum.dynamobim.com/uploads/short-url/9xHmkjXkm1ir7891pCWvUuVP1hM.dyn) (7.5 KB)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [January 15, 2021, 7:52pm UTC](https://forum.dynamobim.com/t/issue-with-if-else-and-list-dropitems/59341/4 "2021-01-15T19:52:35Z")

</div>

Thanks @Vikram_Subbaiah!
