# Compare two lists

**URL:** <https://forum.dynamobim.com/t/compare-two-lists/37255>\
**Category:** Lists-Logic\
**Created:** [June 17, 2019, 11:11am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255 "2019-06-17T11:11:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![frodriguezmXYFSS](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@frodriguezmXYFSS](https://forum.dynamobim.com/u/frodriguezmXYFSS)\
**Post date:** [June 17, 2019, 11:11am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/1 "2019-06-17T11:11:04Z")

</div>

Dears,

I need help to fix this issue. I’m trying to get a boolen list comparing to uniqual list, but what I get it’s not a proper result. FInd image below:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/69d33a7822870967804a5f565bf8ef7f5d48a05b.png)

What I’m lookinf for it’s a list such as this one:

[false, true, true, true, true, true, true, true, true, true, false, false, false,…]

Why cannot I get it correctly?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2019, 11:32am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/2 "2019-06-17T11:32:25Z")

</div>

Not sure what you are after, but I think you are asking ‘does List A contains any of the items in List B?”

If so, an == node with cross product lacing, followed by a List.Contains node with true as the item and longest lacing should do the trick.

---

<div class="post-metadata">

**Author:** ![frodriguezmXYFSS](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@frodriguezmXYFSS](https://forum.dynamobim.com/u/frodriguezmXYFSS)\
**Post date:** [June 17, 2019, 11:43am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/3 "2019-06-17T11:43:38Z")

</div>

What I’m looking for it’s compare list 1 with list 2 get a list showing wich values in 2 are in 1.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9c323d3acb75808a2df5bd52d741af6dd127b24b.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2019, 12:14pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/4 "2019-06-17T12:14:57Z")

</div>

== node with cross product lacing.  
List.Contains to look for a ‘true’ with longest lacing.

---

<div class="post-metadata">

**Author:** ![Thomas.lcp](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Thomas.lcp](https://forum.dynamobim.com/u/Thomas.lcp)\
**Post date:** [June 17, 2019, 12:32pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/5 "2019-06-17T12:32:03Z")

</div>

Hi !

I have a solution i think.

Say me if it’s good for you 🙂

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

---

<div class="post-metadata">

**Author:** ![frodriguezmXYFSS](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@frodriguezmXYFSS](https://forum.dynamobim.com/u/frodriguezmXYFSS)\
**Post date:** [June 17, 2019, 2:00pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/6 "2019-06-17T14:00:45Z")

</div>

I don’t get the requeried list ☹

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2019, 2:17pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/7 "2019-06-17T14:17:52Z")

</div>

Swap your X and Y inputs in the == node, or use a List.Transpose node immediately after it.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [June 17, 2019, 2:51pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/8 "2019-06-17T14:51:26Z")

</div>

List.Contains should be all you need.

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2019, 2:59pm UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/9 "2019-06-17T14:59:46Z")

</div>

The solution I proposed:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4de99d4da8e004d9ab6cac7aa6ab2f5426c5dd56.jpeg)

---

<div class="post-metadata">

**Author:** ![frodriguezmXYFSS](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@frodriguezmXYFSS](https://forum.dynamobim.com/u/frodriguezmXYFSS)\
**Post date:** [June 18, 2019, 7:40am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/10 "2019-06-18T07:40:34Z")

</div>

Thank you, this solved my problema.

---

<div class="post-metadata">

**Author:** ![Thomas.lcp](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Thomas.lcp](https://forum.dynamobim.com/u/Thomas.lcp)\
**Post date:** [June 18, 2019, 8:11am UTC](https://forum.dynamobim.com/t/compare-two-lists/37255/11 "2019-06-18T08:11:54Z")

</div>

Which post ?  
Click solved on it 😉
