# Create sublists by same name

**URL:** <https://forum.dynamobim.com/t/create-sublists-by-same-name/70440>\
**Category:** Revit\
**Tags:** list-filter\
**Created:** [November 16, 2021, 1:10pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440 "2021-11-16T13:10:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimetrios](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Dimetrios](https://forum.dynamobim.com/u/Dimetrios)\
**Post date:** [November 16, 2021, 1:10pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/1 "2021-11-16T13:10:26Z")

</div>

Hey ! I have a list of walls sorted by wall names and i want to create a new list for each walltype. So is there a way to get all the identical objects out of a list an transfer it to a new one. i don’t want to filter by a name because they are changing a lot and i don’t want to add additional codeblocks to the script.

I really new to Dynamo, so thank you for your help

 ![List_Filter](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/7/f7d29829c017b2eb66b36047ca74cc17e8af2562.png)

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 16, 2021, 1:18pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/2 "2021-11-16T13:18:30Z")

</div>

Hi,

Welcome to the forum.

You can sort or group your elements with this nodes:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/8/a8a548174dfb4adcd8405937fe9f21c1fd370529.jpeg)

---

<div class="post-metadata">

**Author:** ![Dimetrios](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Dimetrios](https://forum.dynamobim.com/u/Dimetrios)\
**Post date:** [November 16, 2021, 1:58pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/3 "2021-11-16T13:58:02Z")

</div>

Thanks that was really helpful in the first place. Is there way to create multiple list outputs then ? So in my case i have 5 groups so i want to have 5 separate lists from this node ? without using get the item at an index number

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

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 16, 2021, 2:11pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/4 "2021-11-16T14:11:42Z")

</div>

I don’t know what you mean, you have 5 lists in youre watch node right?

---

<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:** [November 16, 2021, 2:21pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/5 "2021-11-16T14:21:56Z")

</div>

![Screenshot 2021-11-01 200911](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/66dc888caf1fd1dba01bad6a4131cf148371e40c.jpeg)

---

<div class="post-metadata">

**Author:** ![aaronrumple](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aaronrumple/32/195292_2.png) [@aaronrumple](https://forum.dynamobim.com/u/aaronrumple)\
**Post date:** [November 16, 2021, 2:26pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/6 "2021-11-16T14:26:29Z")

</div>

I think this is what you are trying to do, yes?

 ![List](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c41e220ff843dbc780ca3259c94fe58a3dde1ced.png)

Deconstruct will break a list into two parts. Keep doing that and you’ll have your separate lists. Unfortunately, you probably don’t know if you will have 5 items or 20 items. So this isn’t to robust. And I’m not sure you really need them all separate downstream (or really want them separate). Hard to say.

So you would need a function - but even that will give you separate outputs that need to be mapped to nodes or a list of lists (which you already have).

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 16, 2021, 2:27pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/7 "2021-11-16T14:27:54Z")

</div>

I think I know what he wants, I think he wants a node with 5 outputs in this case. if there are 6 keys then he wants 6 outputs. As far as I know this is not possible right?

---

<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:** [November 16, 2021, 2:28pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/8 "2021-11-16T14:28:06Z")

</div>

Hi Aaron…great way 😉

---

<div class="post-metadata">

**Author:** ![aaronrumple](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aaronrumple/32/195292_2.png) [@aaronrumple](https://forum.dynamobim.com/u/aaronrumple)\
**Post date:** [November 16, 2021, 2:29pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/9 "2021-11-16T14:29:53Z")

</div>

Note the issue here is you need to know how many outputs you are dealing with. If there are always 5 - then you are good. But what if there are 100? You could make a code block that outputs 100, and then deal with the nulls if there are only 5. But that’s a lot of overhead.

I’m guessing there is a better way without separating the list of lists. What are you pplanning on eventually doing with these separate lists?

---

<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:** [November 16, 2021, 2:30pm UTC](https://forum.dynamobim.com/t/create-sublists-by-same-name/70440/10 "2021-11-16T14:30:52Z")

</div>

There is no way to create multiple outputs like you want from a single node (without knowing how many you need ahead of time). However, it’s actually better to learn how to handle your sublists individually than to try splitting your sublists into separate lists.
