# Limited list size while using IF statement

**URL:** <https://forum.dynamobim.com/t/limited-list-size-while-using-if-statement/75891>\
**Category:** Lists-Logic\
**Tags:** dynamo\
**Created:** [April 26, 2022, 7:54pm UTC](https://forum.dynamobim.com/t/limited-list-size-while-using-if-statement/75891 "2022-04-26T19:54:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [April 26, 2022, 9:05pm UTC](https://forum.dynamobim.com/t/limited-list-size-while-using-if-statement/75891/2 "2022-04-26T21:05:20Z")

</div>

The output length is being governed by the shortest list length within the data-set due to lacing.  
This is the built-in behaviour, possibly to avoid data loss if lacing is not set correctly, as I can recall seeing this previously on the forum, such as here.

> [@Code block bug: if true a, else b - returns shortest list](https://forum.dynamobim.com/t/code-block-bug-if-true-a-else-b-returns-shortest-list/40440):
>
> Is this a bug? Returns a list of values equal to the shortest inputlist… [image] [image]

In cases such as this, using OOTB nodes or a small amount of python will give you the desired result.

```auto
input = IN[0]
list1 = [1,2,3]
list2 = [1,2,3,4,5]
list3 = [1,2,3,4,5,6,7]
if input == 1:
	OUT = list1
elif input == 2:
	OUT = list2
else:
	OUT = list3

```

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/b/0b5d1d21d95046bc2ecb8e4e7fc194f640885826.png)

---

_[View the full topic](https://forum.dynamobim.com/t/limited-list-size-while-using-if-statement/75891)._
