# Empty List replace

**URL:** <https://forum.dynamobim.com/t/empty-list-replace/22805>\
**Category:** Revit\
**Created:** [June 13, 2018, 6:32pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805 "2018-06-13T18:32:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![3Pinter](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/3pinter/32/74327_2.png) [@3Pinter](https://forum.dynamobim.com/u/3Pinter)\
**Post date:** [June 13, 2018, 6:32pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805/1 "2018-06-13T18:32:49Z")

</div>

What am I missing?

two of the same lists, connect to setdifference node results in an obvious ‘empty list’.

Now I’m doing some code block to do an “if empty list, then do something, else show list”.  
BUT the phrase “Empty List” is ignored, so is “” … now what?

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/8/a8fae18dbb3760fefb07b0db593c623bc4dcdc0d.png)

---

<div class="post-metadata">

**Author:** ![franciscopossetto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/franciscopossetto/32/38230_2.png) [@franciscopossetto](https://forum.dynamobim.com/u/franciscopossetto)\
**Post date:** [June 13, 2018, 6:47pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805/2 "2018-06-13T18:47:20Z")

</div>

you could use Clockwork node “List.ReplaceEmptyList”. I try with python and works too.  
The phrase “Empty List” is taken as string.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/d/cde3a0b19a645a67b4b8f090a11c8e006d1af4f6.PNG)

---

<div class="post-metadata">

**Author:** ![3Pinter](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/3pinter/32/74327_2.png) [@3Pinter](https://forum.dynamobim.com/u/3Pinter)\
**Post date:** [June 13, 2018, 7:08pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805/3 "2018-06-13T19:08:56Z")

</div>

@franciscopossetto yes, python makes this a breeze.

But let’s stick to a single code block, for fun times. How do we reproduce the same output as python does? or as my example is trying to do.

if a == empty list (or: if not a) … do this, else that.

---

<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:** [June 13, 2018, 7:14pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805/4 "2018-06-13T19:14:02Z")

</div>

@3Pinter Use the built in List.IsEmpty

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

---

<div class="post-metadata">

**Author:** ![3Pinter](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/3pinter/32/74327_2.png) [@3Pinter](https://forum.dynamobim.com/u/3Pinter)\
**Post date:** [June 13, 2018, 7:15pm UTC](https://forum.dynamobim.com/t/empty-list-replace/22805/5 "2018-06-13T19:15:13Z")

</div>

@awilliams,

awesome. thanks a lot!
