# Deleting only certain null values in a list

**URL:** <https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885>\
**Category:** Uncategorized\
**Created:** [July 30, 2019, 1:30pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885 "2019-07-30T13:30:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apiazzaZ6J42](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@apiazzaZ6J42](https://forum.dynamobim.com/u/apiazzaZ6J42)\
**Post date:** [July 30, 2019, 1:30pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885/1 "2019-07-30T13:30:58Z")

</div>

Hello,  
If anyone could help me out here I would appreciate it. So, I am trying take data from excel and make sheets with the parameter values, Drawing Number, Drawing Title, Line 2, and Line 3 (This can be seen in Excel picture below). My code works good to make the sheets with those parameters. The problem I am having is that sometimes our drawings don’t have a Line 3 name, as can be seen. I am able to get rid of nulls for the line spacing between row 17 and 18 and then I just transpose the list but it also gets rid of the nulls for the empty line 3 values which is a problem because then my list don’t match up. Does anyone know of a way where i can keep those null values in the line 3 column?

 ![sheet_pic](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/3/d36105afc99b83884fe62a5f2f11416e7c3edb56.jpeg)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [July 30, 2019, 1:44pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885/2 "2019-07-30T13:44:26Z")

</div>

You could do an if statement to check if there is a null in a certain column, like column A. Something that there should always be a value if the row should stay. From there, anytime you find a null in that column, remove that row. It is more complicated than a single List.Clean node but should work.

---

<div class="post-metadata">

**Author:** ![apiazzaZ6J42](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@apiazzaZ6J42](https://forum.dynamobim.com/u/apiazzaZ6J42)\
**Post date:** [July 30, 2019, 1:49pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885/3 "2019-07-30T13:49:41Z")

</div>

Thanks for the quick reply! Would this still allow the nulls to stay in the line 3 parameter because I don’t want to delete the rows without a line 3 parameter. I just want to make that sheet not have a line 3 parameter. Sorry if my wording is a little confusing.

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [July 30, 2019, 1:53pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885/4 "2019-07-30T13:53:54Z")

</div>

Yes it will. Here is a picture, should better explain it:

 ![removenullsonlyif](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/f/bfe8cc471278f5d985e3da495d558503f7474ad5.png)

It checks a certain index for nulls and removes only those lines. So it won’t affect any lines that has a null only in line 3. Alternatively you could check if all items in a list are null and remove them that way. This would look like:

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

---

<div class="post-metadata">

**Author:** ![apiazzaZ6J42](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@apiazzaZ6J42](https://forum.dynamobim.com/u/apiazzaZ6J42)\
**Post date:** [July 30, 2019, 2:02pm UTC](https://forum.dynamobim.com/t/deleting-only-certain-null-values-in-a-list/38885/5 "2019-07-30T14:02:30Z")

</div>

Yes! Thank you so much this is exactly what I needed!
