# List from other sublist

**URL:** <https://forum.dynamobim.com/t/list-from-other-sublist/21312>\
**Category:** Lists-Logic\
**Tags:** dynamo\
**Created:** [April 23, 2018, 1:46pm UTC](https://forum.dynamobim.com/t/list-from-other-sublist/21312 "2018-04-23T13:46:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davor](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@Davor](https://forum.dynamobim.com/u/Davor)\
**Post date:** [April 23, 2018, 1:46pm UTC](https://forum.dynamobim.com/t/list-from-other-sublist/21312/1 "2018-04-23T13:46:27Z")

</div>

Hi,

I have certain elements in some rooms, to which I want to add parameters related to that room. Everything else is solved except the issue of creating a list of rooms which contain element with same index as those elements.

Looking at the following image, I would like to get Room list with only those rooms which have that element. So if I have 2 or more elements in same room (this creates sublist of elements) that I have that room same number of times in the list on same index as element.

I hope you understand my point.  
Thanks

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

---

<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:** [April 23, 2018, 2:35pm UTC](https://forum.dynamobim.com/t/list-from-other-sublist/21312/2 "2018-04-23T14:35:59Z")

</div>

After Elements in Room try a IsNull node to see which sublists have elements in them. Then use FilterByBoolMask to filter your list of rooms for those with elements.

---

<div class="post-metadata">

**Author:** ![Moschi](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Moschi](https://forum.dynamobim.com/u/Moschi)\
**Post date:** [April 24, 2018, 9:34am UTC](https://forum.dynamobim.com/t/list-from-other-sublist/21312/3 "2018-04-24T09:34:55Z")

</div>

I’m facing exactly the same Problem at the moment. I’m using **Room.IsInsideRoom** to check (set to cross product). This function is also used by your node from archilab. I Need to check against Points of the Family Location because my rooms come from an linked file (imported at the wrong Location so I Need to move the Points of the Family - other story :D).

That gives me an list with all rooms at first Level and second level a boolean for each element in my list. I then check the index of each “true” element and retrieve the element.

At some point I have a list with 4 rooms (as example) which have 0-3 elements inside.

To export a list to Excel I need two lists with same length. This is my solution and I think it’s also what you’re looking for:

 ![Dynamo_Cycle](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/4/f4f35e1878594e240a64453e9d85c07a1258c6a8.PNG)

---

<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:** [April 25, 2018, 12:32pm UTC](https://forum.dynamobim.com/t/list-from-other-sublist/21312/4 "2018-04-25T12:32:22Z")

</div>

Rhythm also has a node Element.Room which returns the room an element is in. You’d be able to use this along with GroupByKey to get your elements by room.
