# Removing items from a list if some parameters are empty

**URL:** <https://forum.dynamobim.com/t/removing-items-from-a-list-if-some-parameters-are-empty/1750>\
**Category:** Packages\
**Created:** [July 7, 2015, 4:17am UTC](https://forum.dynamobim.com/t/removing-items-from-a-list-if-some-parameters-are-empty/1750 "2015-07-07T04:17:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Hurtubise](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daniel_hurtubise/32/146534_2.png) [@Daniel\_Hurtubise](https://forum.dynamobim.com/u/Daniel_Hurtubise)\
**Post date:** [July 7, 2015, 4:17am UTC](https://forum.dynamobim.com/t/removing-items-from-a-list-if-some-parameters-are-empty/1750/1 "2015-07-07T04:17:41Z")

</div>

Title says it all 🙂

I want to make sure that my list only contains elements that have all the parameters filed. I looked into the List.Clean and attached a boolean true/False to the preserveindices. The output i get is the same as the list. It doesnt seem to filter out the element that doesnt have the value filled.

![SheetFilteringNullValues](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/b/b4e4d6e7bcb731d1a855ea2a3bdd3eee21fe73fa.jpg)

&nbsp;

---

<div class="post-metadata">

**Author:** ![Daniel\_Hurtubise](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daniel_hurtubise/32/146534_2.png) [@Daniel\_Hurtubise](https://forum.dynamobim.com/u/Daniel_Hurtubise)\
**Post date:** [July 7, 2015, 4:49am UTC](https://forum.dynamobim.com/t/removing-items-from-a-list-if-some-parameters-are-empty/1750/2 "2015-07-07T04:49:49Z")

</div>

ok, here’s what i came up with

If true = value and false=null. Then pass that into LunchBox Remove Null Values and im left with only the sheets that have values.

&nbsp;

Problem is that if i connect that last list to an Element.GetParameterValuesB yName it fails.  
Here’s a download link to my test if anyone has time [https://www.dropbox.com/s/c646lvuws1ne2fg/SheetFilteringNullValues.zip?dl=0](https://www.dropbox.com/s/c646lvuws1ne2fg/SheetFilteringNullValues.zip?dl=0)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 7, 2015, 5:57am UTC](https://forum.dynamobim.com/t/removing-items-from-a-list-if-some-parameters-are-empty/1750/3 "2015-07-07T05:57:05Z")

</div>

Not a solution, but the cause of your problem is probably indicated in the values of the _String.CountOccurences_ node. You should be able to use this to filter your results.

Index [0] doesn’t seem to be, either, empty or null.

I’m not sure if there is there a way to check for an empty string.

![20150707-1](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/0/04b4a236ed31f60f98e1637556ae254ebd7f4974.jpg)
