# If node not working with two lists

**URL:** <https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [April 23, 2022, 4:31am UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764 "2022-04-23T04:31:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![salmanjavaid2000](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salmanjavaid2000/32/134610_2.png) [@salmanjavaid2000](https://forum.dynamobim.com/u/salmanjavaid2000)\
**Post date:** [April 23, 2022, 4:31am UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/1 "2022-04-23T04:31:03Z")

</div>

I have two lists, both opened up. One has 44 items, other has 1. When I use IF node, no matter true or false, the result is always 0 (First number of both lists). Does it require that both lists should have equal number of items? If yes, how can I make it equal, considering that the number of items can change depending upon the Revit Model.

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

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [April 23, 2022, 5:20am UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/2 "2022-04-23T05:20:39Z")

</div>

Hello…could you zoom in your image or share the graph…cant really see whats goin on

---

<div class="post-metadata">

**Author:** ![salmanjavaid2000](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salmanjavaid2000/32/134610_2.png) [@salmanjavaid2000](https://forum.dynamobim.com/u/salmanjavaid2000)\
**Post date:** [April 23, 2022, 10:54am UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/3 "2022-04-23T10:54:29Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/6/5692bd84d8e9aaa7f68eff90a0e0d9fae9094f12.jpeg)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [April 23, 2022, 12:14pm UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/4 "2022-04-23T12:14:56Z")

</div>

Hello, as you are sending a value and not a comparison your if becomes invalid and returns the value of false 0 look at the dictionary with examples

[https://dictionary.dynamobim.com/#/Core/Logic/Action/If](https://dictionary.dynamobim.com/#/Core/Logic/Action/If)

Cordially  
Christian.stan

edit:  
Good evening, I had badly seen your connection, here is a solution

 ![sol](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/7/476a6394b51602f3f5fd5717796e2490a39d7fdf.png)

Have a good evening.

cordially  
christian.stan

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [April 23, 2022, 12:15pm UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/5 "2022-04-23T12:15:27Z")

</div>

Hi there. I have come across this problem. Dynamos conditional statements seem to require equal list or they don’t work properly. You will have to use some python for this. I’ll send you a link.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [April 23, 2022, 12:17pm UTC](https://forum.dynamobim.com/t/if-node-not-working-with-two-lists/75764/6 "2022-04-23T12:17:38Z")

</div>

> [@Create sheets and place multiple views](https://forum.dynamobim.com/t/create-sheets-and-place-multiple-views/74182/7):
>
> Hi @jacob.small Thanks! I figured it out. If you look at the sorted views in the second image, you will notice that the conditional statement in Dynamo returns the same view. I have seen that the conditional statements do not work as intended when the lists being dealt with are somewhat long. So I have dealt with it in Python, and it works just fine now. Thank you.

See here.  
Easy to replicate.
