# List B as sublist of list A

**URL:** <https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618>\
**Category:** Lists-Logic\
**Created:** [October 7, 2016, 3:05pm UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618 "2016-10-07T15:05:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ka-Ko](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Ka-Ko](https://forum.dynamobim.com/u/Ka-Ko)\
**Post date:** [October 7, 2016, 3:05pm UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/1 "2016-10-07T15:05:21Z")

</div>

Hello everyone !  
I am also pretty new to Dynamo, and I guess what I am trying to do should be very simple, but I cant make it work.

I have list A and list B and I want List B (and its sublists) to be the sublist of list A. it should be something like this:

A1

- B1a
- B1b
- B1x  
A2
- B2a
- B2b
- B2x

Can someone help me out?

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/5/524cc527a88a143c4428110dc378a1e4c3c43b07.JPG)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [October 7, 2016, 4:16pm UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/2 "2016-10-07T16:16:41Z")

</div>

Hi Kalle,

You can just use “List.LastItem” node with lacing to longest.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [October 8, 2016, 6:43am UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/3 "2016-10-08T06:43:10Z")

</div>

Something like this?  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/f/fdc0be5a038dcbf3f710816b16a0be85ac3a6adc.png)

---

<div class="post-metadata">

**Author:** ![Ka-Ko](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Ka-Ko](https://forum.dynamobim.com/u/Ka-Ko)\
**Post date:** [October 10, 2016, 12:46pm UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/4 "2016-10-10T12:46:48Z")

</div>

@ Kulkul: how can I combine list A and list B with the “List.LastItem”-node?  
@ Vikram\_Subbaiah: Yes, something like this but for now the Input is little different…

So, I have a List A with Wall-IDs. The Walls are divided in multiple parts, so the same ID appears there multiple times. Then I have List B with represents the length of each part of the Walls.

The Goal is, to make a List with the Wall-IDs and assign the correct length as a sublist to each Wall.

Wall 1 (part 1)

- Length 1  
Wall 1 (part 2)
- Length 2  
Wall 1 (part 3)
- Length 3  
Wall 2 (part 1)
- Length 4  
Wall 3 (part 1)
- Length 5  
Wall 4 (part 1)
- Length 6  
Wall 4 (Part 2)
- Length 7

Then I want to sort all Wall-IDs and have all length of the same wall under each other.

Wall 1

- Length 1
- Length 2
- Length 3  
Wall 2
- Length 4  
Wall 3
- Length 5  
Wall 4
- Length 6
- Length 7

---

<div class="post-metadata">

**Author:** ![Scott\_Crichton](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/scott_crichton/32/8876_2.png) [@Scott\_Crichton](https://forum.dynamobim.com/u/Scott_Crichton)\
**Post date:** [October 11, 2016, 3:51am UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/5 "2016-10-11T03:51:50Z")

</div>

Is this what you are after? I have created 2 possible outputs depending on your requirements.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/1024be3e456deed24385ebfcb3911090f8f5808b.jpg)

---

<div class="post-metadata">

**Author:** ![Ka-Ko](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Ka-Ko](https://forum.dynamobim.com/u/Ka-Ko)\
**Post date:** [October 11, 2016, 7:26am UTC](https://forum.dynamobim.com/t/list-b-as-sublist-of-list-a/6618/6 "2016-10-11T07:26:28Z")

</div>

GREAT !!  
this is exactly what i was looking for !  
Thanks a lot
