# Separate List into Two Separate Lists Based on Text

**URL:** <https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380>\
**Category:** Lists-Logic\
**Tags:** revit, dynamo\
**Created:** [December 13, 2017, 11:58pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380 "2017-12-13T23:58:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![christianjgentry](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@christianjgentry](https://forum.dynamobim.com/u/christianjgentry)\
**Post date:** [December 13, 2017, 11:58pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/1 "2017-12-13T23:58:35Z")

</div>

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

Hello All,

I am trying to separate my wall types into two groups. Interior and Exterior. I would like to have a list for each group. My plan is to call to the name of each type because they are labeled as interior and exterior, however I am unable to find out how to do this. Could someone kindly review my node setup and guide me to the next step? Thanks a ton!

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [December 14, 2017, 12:10am UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/2 "2017-12-14T00:10:45Z")

</div>

You are close! If you connect a Watch node to your String from Array node you will see that this node turns your list(array) into a single string. Replace that node with String from Object and you will see a list of booleans in the watch node connected to the String.Contains node, you can then use those booleans with List.FilterByBoolMask nodes 🙂

---

<div class="post-metadata">

**Author:** ![christianjgentry](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@christianjgentry](https://forum.dynamobim.com/u/christianjgentry)\
**Post date:** [December 14, 2017, 2:34pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/3 "2017-12-14T14:34:28Z")

</div>

![DynamoHelp2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/7/079d1b51d4ae3a909166532ce55ba6a26f8267ba.png)  
Thank you @awilliams! That got it! My end goal is to assign these two lists to different worksets. My last two groups of nodes work when pulling elements from a category, but not from these lists. My guess is that I need to now convert these two lists from strings back to elements. Is this the case, and if so what is the method of doing so? What am I missing? I appreciate the help!

---

<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:** [December 14, 2017, 2:39pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/4 "2017-12-14T14:39:44Z")

</div>

Hi @christianjgentry

You need to connect elements lists at filterbybool mask node. Element.SetParameter node needs elements to set the values currently your assigning strings.

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

---

<div class="post-metadata">

**Author:** ![christianjgentry](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@christianjgentry](https://forum.dynamobim.com/u/christianjgentry)\
**Post date:** [December 14, 2017, 3:14pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/5 "2017-12-14T15:14:48Z")

</div>

![Workset Script Interior-Exterior](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/7/d7740387c7529f7726a7104d35338f979429b155.png)  
Thanks a ton @Kulkul! That really put me on the right path. I tried making the connection where you showed me but I actually had to go one list back for it to work. I attached the working script to show. Thank you all so much again, that solved my problem and I learned a ton!

---

<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:** [December 14, 2017, 3:23pm UTC](https://forum.dynamobim.com/t/separate-list-into-two-separate-lists-based-on-text/17380/6 "2017-12-14T15:23:03Z")

</div>

@christianjgentry You’re welcome!
