# Joining string lists. Drop the nulls

**URL:** <https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990>\
**Category:** Lists-Logic\
**Created:** [May 24, 2023, 12:24pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990 "2023-05-24T12:24:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jack/32/44338_2.png) [@Jack](https://forum.dynamobim.com/u/Jack)\
**Post date:** [May 24, 2023, 12:24pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/1 "2023-05-24T12:24:59Z")

</div>

Probably an easy one for you guys.  
I’m trying to join two lists and only keep the values that aren’t null or “”.

Using the A+B drops D. Why? Is there a better way?  
Thanks again!

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

---

<div class="post-metadata">

**Author:** ![gilberto.arechigaiba](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gilberto.arechigaiba/32/204980_2.png) [@gilberto.arechigaiba](https://forum.dynamobim.com/u/gilberto.arechigaiba)\
**Post date:** [May 24, 2023, 12:47pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/2 "2023-05-24T12:47:28Z")

</div>

Amigo @Jack buenas, you want Joint List, or Join Strings??  
Check this out!!

> [@Join Lists](https://forum.dynamobim.com/t/join-lists/80236/5):
>
> This is also a solution Maybe?

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 24, 2023, 12:47pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/3 "2023-05-24T12:47:29Z")

</div>

@Jack ,

you can also use boolean operators.

> [@Filter by layers](https://forum.dynamobim.com/t/filter-by-layers/89877):
>
> Hello everyone, how to filter sublist that contains another sublist in a proper order? Elements can only be before and after. Thanks in advance.

f.e.

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/e/7e36037256972d8f7bee7645dfc42a5ecf4d3e0b.png)

KR

ANdreas

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jack/32/44338_2.png) [@Jack](https://forum.dynamobim.com/u/Jack)\
**Post date:** [May 24, 2023, 9:54pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/4 "2023-05-24T21:54:11Z")

</div>

Thanks! List.SetUnion was the solution. So simple 😃

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jack/32/44338_2.png) [@Jack](https://forum.dynamobim.com/u/Jack)\
**Post date:** [May 24, 2023, 9:59pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/5 "2023-05-24T21:59:12Z")

</div>

I got excited that it appeared to work, but it put the results out of order. Keep the list structure is vital.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/0/d0d1066a98ca12b712766ace5742f8ddf804ef7a.png)

---

<div class="post-metadata">

**Author:** ![Hamish](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hamish](https://forum.dynamobim.com/u/Hamish)\
**Post date:** [May 24, 2023, 10:21pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/6 "2023-05-24T22:21:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jack/32/44338_2.png) [@Jack](https://forum.dynamobim.com/u/Jack)\
**Post date:** [May 24, 2023, 10:35pm UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/7 "2023-05-24T22:35:37Z")

</div>

Thanks Hamish. Transpose,Concat,Flatten. Thats going to be used a lot.

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [May 25, 2023, 6:19am UTC](https://forum.dynamobim.com/t/joining-string-lists-drop-the-nulls/89990/8 "2023-05-25T06:19:54Z")

</div>

Hi @Jack ,

I think in your first attempt with the Code Block “a+b” does drop the last item since it is (automatically) set to shortest lacing.  
If you use the + node, not a code block, and set it to longest lacing it should work.
