# List.ReplaceEmptyLists (Clockwork Package)

**URL:** <https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339>\
**Category:** Packages\
**Created:** [October 7, 2015, 12:13pm UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339 "2015-10-07T12:13:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lejla\_Secerbegovic](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@Lejla\_Secerbegovic](https://forum.dynamobim.com/u/Lejla_Secerbegovic)\
**Post date:** [October 7, 2015, 12:13pm UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339/1 "2015-10-07T12:13:06Z")

</div>

Hi guys, hi Andy 😉

I’m despreately trying to make the List.ReplaceEmptyLists work (I have the latest Clockwork version installed + Dynamo 0.8.2) and it just won’t work!

As a matter of fact it’s replacing just the first empty item:

&nbsp;

![07-10-2015 19-36-25](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/3/3eff811733860546cdc231ae6be8d1c2d218308d.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

If I choose a list as input for “replacement”, then the node will replace as many empty lists as there are items in the list.

Obviously this could do the trick, but it’s not really an elegant solution and I guess it’s just a little tweak in the custom node, or?

&nbsp;

Thx!

Lejla

---

<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:** [October 7, 2015, 12:19pm UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339/2 "2015-10-07T12:19:33Z")

</div>

Hi Lejla,

Did you try changing Lacing to longest.

---

<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:** [October 7, 2015, 1:46pm UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339/3 "2015-10-07T13:46:51Z")

</div>

Lejla, If it doesn’t work for you try “ReplaceByCondition” node.

![Untitled](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/4/41e092392861c72380e528a9b2d7fa1eb7a8f79a.png)

---

<div class="post-metadata">

**Author:** ![Lejla\_Secerbegovic](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@Lejla\_Secerbegovic](https://forum.dynamobim.com/u/Lejla_Secerbegovic)\
**Post date:** [October 19, 2015, 6:39am UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339/4 "2015-10-19T06:39:32Z")

</div>

Kulkul, first of all thanks a lot and apologies for replying only now, unfortunately I got stuck in non-Dynamo related work ☹

I did try different lacing, however it didn’t work either - ReplaceByCondition is a perfect workaround of course, thanks once again!

Cheers, Lejla

---

<div class="post-metadata">

**Author:** ![Giovanni\_Succi](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Giovanni\_Succi](https://forum.dynamobim.com/u/Giovanni_Succi)\
**Post date:** [February 18, 2016, 6:11pm UTC](https://forum.dynamobim.com/t/list-replaceemptylists-clockwork-package/2339/5 "2016-02-18T18:11:06Z")

</div>

Unfortunately this does not work if the original list is composed of elements and lists… Below, the resulting list is identical to the source list:

If I flatten the list, then the Empty List disappears and I loose the total number of items in the list…

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/0/0b090e2a8051ea84f66d264cbd2377160ce89f63.png)
