# List with sublist and the previous and next sublist

**URL:** <https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189>\
**Category:** Uncategorized\
**Created:** [March 4, 2021, 11:37am UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189 "2021-03-04T11:37:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FRAN1972](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@FRAN1972](https://forum.dynamobim.com/u/FRAN1972)\
**Post date:** [March 4, 2021, 11:37am UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/1 "2021-03-04T11:37:48Z")

</div>

Hie,  
I am trying to create a list with three list, 0,1,2 List //1,2,3 List//2,3,4 List//… I mean the list, the previous and the next list.  
Anybody could help me?  
Regards.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b4c93adb042697d1d26b73daa0cb4eb7654c88f3.png)  
This but in automatically way to all the sublists  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/f/cfd1dbb10eeb270a04d3b0f4618a7c67d890da42.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [March 4, 2021, 12:27pm UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/2 "2021-03-04T12:27:57Z")

</div>

Look at the List@Level paragraph in this part of the Dynamo Primer.  
[https://primer.dynamobim.org/06\_Designing-with-Lists/6-3\_lists-of-lists.html](https://primer.dynamobim.org/06_Designing-with-Lists/6-3_lists-of-lists.html)

---

<div class="post-metadata">

**Author:** ![FRAN1972](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@FRAN1972](https://forum.dynamobim.com/u/FRAN1972)\
**Post date:** [March 4, 2021, 12:43pm UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/3 "2021-03-04T12:43:16Z")

</div>

Thanks a lot Marcel. Maybe i don´t explain well, my problem is not select the item in differents levels, if not is make list of three components with the item and the previous-next item. I don´t know how to make it for all the items. In the image, i want to make a list with the 0List-1List-2 List, other with 1List-2List-3List,…  
Maybe with List.ShiftIndices…i am going to try it.  
Regards.

---

<div class="post-metadata">

**Author:** ![FRAN1972](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@FRAN1972](https://forum.dynamobim.com/u/FRAN1972)\
**Post date:** [March 4, 2021, 12:59pm UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/4 "2021-03-04T12:59:59Z")

</div>

I don´t know if it is the best way but it works.

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

---

<div class="post-metadata">

**Author:** ![Bjorn\_Keulemans1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bjorn_keulemans1/32/54676_2.png) [@Bjorn\_Keulemans1](https://forum.dynamobim.com/u/Bjorn_Keulemans1)\
**Post date:** [March 4, 2021, 3:08pm UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/5 "2021-03-04T15:08:19Z")

</div>

![pic](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/4/a41bf815eccd358238a694261e165475ad8c2cbf.png)

Think this is what you mean. I drop the First&last because there is no -1 index for the first item and no +1 index for the last item.

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [March 4, 2021, 7:19pm UTC](https://forum.dynamobim.com/t/list-with-sublist-and-the-previous-and-next-sublist/61189/6 "2021-03-04T19:19:35Z")

</div>

@FRAN1972 I think List.Sublists would be a neat solution.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/d/ed5e2ac8831e7e94931bb8d23ad4f34e37412410.png)  
You can drop the first & last list as suggested by @Bjorn_Keulemans1 if required.
