# Change empty lists in sublists into "---"

**URL:** <https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876>\
**Category:** Lists-Logic\
**Tags:** clockwork, python, dynamo\
**Created:** [October 31, 2018, 7:17am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876 "2018-10-31T07:17:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiang19981](https://avatars.discourse-cdn.com/v4/letter/x/9de0a6/32.png) [@xiang19981](https://forum.dynamobim.com/u/xiang19981)\
**Post date:** [October 31, 2018, 7:17am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/1 "2018-10-31T07:17:54Z")

</div>

![Untitled](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/e/2e4a13bdf753e21d6ff663cd7057b08105dc60ff.png)

I have been trying to change all the empty lists into “—”. I have tried the all the three lacings of the “List.ReplaceEmptyLists” node from clockwork but there are still a number of empty lists. Please help me if you have a solution! Thank you!

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 31, 2018, 7:37am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/2 "2018-10-31T07:37:23Z")

</div>

Hi, have you tried Flatten the list(s) or get the indices of “Empty Lists” ?

---

<div class="post-metadata">

**Author:** ![xiang19981](https://avatars.discourse-cdn.com/v4/letter/x/9de0a6/32.png) [@xiang19981](https://forum.dynamobim.com/u/xiang19981)\
**Post date:** [October 31, 2018, 7:55am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/3 "2018-10-31T07:55:49Z")

</div>

I have tried the “Flatten” node, but the “Empty Lists” will all be omitted. Therefore, I hope to replace all “Empty Lists” into “—” first before Flattening the list.

Could you explain more about getting the indices of “Empty Lists”? I think it might work. 🙂

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [October 31, 2018, 8:01am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/4 "2018-10-31T08:01:23Z")

</div>

Have a look at list-levels 🙂

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

@CVestesen by flattening you’re removing the empty lists completely:)

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [November 1, 2018, 6:27am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/5 "2018-11-01T06:27:18Z")

</div>

@Jonathan.Olesen - you’re absolutly right, I didn’t know. Thank you!  
@xiang19981 - sorry for the late answer but I think I would take a look at Jonathan’s answer.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [November 1, 2018, 8:48am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/6 "2018-11-01T08:48:33Z")

</div>

New… and much better answer 🙂 Use the Orchid “replace” node which is working for numerous list depths.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/9/d99dc8bee161f4143693f56fa618fd423fc8083c.png)

---

<div class="post-metadata">

**Author:** ![xiang19981](https://avatars.discourse-cdn.com/v4/letter/x/9de0a6/32.png) [@xiang19981](https://forum.dynamobim.com/u/xiang19981)\
**Post date:** [November 2, 2018, 7:13am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/7 "2018-11-02T07:13:56Z")

</div>

Thank you, I think this is the solution I am looking for! But, I couldn’t find the List.Replace node. By Orchid “replace” node, do you mean it is a node found in the Orchid package?

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [November 2, 2018, 7:15am UTC](https://forum.dynamobim.com/t/change-empty-lists-in-sublists-into/27876/8 "2018-11-02T07:15:32Z")

</div>

Yes the node is found in the orchid package 🙂 if you do not have it installed remember it is installed from github 🙂
