# IF node broken?

**URL:** <https://forum.dynamobim.com/t/if-node-broken/7971>\
**Category:** Revit\
**Created:** [December 5, 2016, 11:21am UTC](https://forum.dynamobim.com/t/if-node-broken/7971 "2016-12-05T11:21:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.Melching](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@M.Melching](https://forum.dynamobim.com/u/M.Melching)\
**Post date:** [December 5, 2016, 11:21am UTC](https://forum.dynamobim.com/t/if-node-broken/7971/1 "2016-12-05T11:21:10Z")

</div>

See the picture below;

I’ve used the IF node and fed it 2 lists and a boolean.  
The Boolean returns true, so the first list should be returned.  
Before the list goes into the IF-node it has 10 items, after it comes out it only has 9 items. Where did the last item go?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/8/383e91f823d3691896ed5e5416b8d1781adf1ecd.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [December 5, 2016, 11:34am UTC](https://forum.dynamobim.com/t/if-node-broken/7971/2 "2016-12-05T11:34:50Z")

</div>

It’s caused by the lacing. The if node has shortes lacing as default, and it can’t be changed. Try the scopif or a simple python script.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/4/8411faa7a9e236241346d16a5965c57708718568.gif)

```
if IN[0]:
	OUT = IN[1]
else:
	OUT = IN[2]
```

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [December 5, 2016, 11:53am UTC](https://forum.dynamobim.com/t/if-node-broken/7971/3 "2016-12-05T11:53:44Z")

</div>

The behavior was changed in this PR:

> <https://github.com/DynamoDS/Dynamo/pull/4464>

Additional notes:

- With a formula node you can change lacing.
- Design Script if behaves the same way as the if node.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/6/86af07c7afa2c973a95b1739794e934d00a6b4de.png)

---

<div class="post-metadata">

**Author:** ![M.Melching](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@M.Melching](https://forum.dynamobim.com/u/M.Melching)\
**Post date:** [December 5, 2016, 12:13pm UTC](https://forum.dynamobim.com/t/if-node-broken/7971/4 "2016-12-05T12:13:56Z")

</div>

Thanks for your reply Einar,

I’ve tried this solution and i’m even more surprised now… this time it misses 2 items in my List.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/8/5829e82a2dd58bbbb8277bcb59cc2bbaed4d0616.png)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 5, 2016, 12:44pm UTC](https://forum.dynamobim.com/t/if-node-broken/7971/5 "2016-12-05T12:44:09Z")

</div>

Hello, could you please tell what is tested with String.Contains?

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [December 5, 2016, 12:45pm UTC](https://forum.dynamobim.com/t/if-node-broken/7971/6 "2016-12-05T12:45:58Z")

</div>

@M.Melching right click the Formula node and choose longes lacing.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 5, 2016, 1:05pm UTC](https://forum.dynamobim.com/t/if-node-broken/7971/7 "2016-12-05T13:05:08Z")

</div>

In principle, it works:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/e/aed13dafeffb73f553c6a8abc7ca2208fd0f2c31.JPG)

---

<div class="post-metadata">

**Author:** ![M.Melching](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@M.Melching](https://forum.dynamobim.com/u/M.Melching)\
**Post date:** [December 5, 2016, 2:31pm UTC](https://forum.dynamobim.com/t/if-node-broken/7971/8 "2016-12-05T14:31:15Z")

</div>

> [@Einar\_Raknes](#):
>
> hoose longes lacing.

This was the right answer. Well, it was the lacing. It chose the shortest list as lacing. Thanks for solving this
