# Replace null with with data from previous node

**URL:** <https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587>\
**Category:** Uncategorized\
**Created:** [December 17, 2019, 12:18pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587 "2019-12-17T12:18:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 17, 2019, 12:18pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/1 "2019-12-17T12:18:33Z")

</div>

If I am editing my data with other components and some of those edits do not apply it comes back with a null, but what I want is the previous data that was unaffected so how would one replace nulls with data that has not been affected? Thank you for your help in advance!

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

---

<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:** [December 17, 2019, 1:41pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/2 "2019-12-17T13:41:45Z")

</div>

Very crude example, but you could utilize something like this

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

---

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 17, 2019, 2:14pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/3 "2019-12-17T14:14:54Z")

</div>

Thanks Jonathan, is there a way to scale this if null occurs more than once, do I need to change my lacing?

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

---

<div class="post-metadata">

**Author:** ![lkichenin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lkichenin/32/96679_2.png) [@lkichenin](https://forum.dynamobim.com/u/lkichenin)\
**Post date:** [December 17, 2019, 2:19pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/4 "2019-12-17T14:19:30Z")

</div>

I suggest a condition for this, see below :

 ![Condition](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/3/63fc74ab93d08b2b8f95a58a77c5aad99e76c8b5.png)

---

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 17, 2019, 2:22pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/5 "2019-12-17T14:22:29Z")

</div>

problem with this is that I still have to identify the previous surface from the list therefore I still need to find all the indexes of null and we can do it for one but not for multiples atm.

---

<div class="post-metadata">

**Author:** ![lkichenin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lkichenin/32/96679_2.png) [@lkichenin](https://forum.dynamobim.com/u/lkichenin)\
**Post date:** [December 17, 2019, 2:53pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/6 "2019-12-17T14:53:45Z")

</div>

Provided you have the same list structures between the input lists, it should work the same. Here is an example with different geometries which would be your surfaces :

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

---

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 17, 2019, 3:02pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/7 "2019-12-17T15:02:02Z")

</div>

Apologises, I misread that code block. Thank you so much!

---

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 17, 2019, 3:35pm UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/8 "2019-12-17T15:35:38Z")

</div>

Ikichenin, what would you do in the situation where a list has more than one items, I am getting this error:

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

---

<div class="post-metadata">

**Author:** ![lkichenin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lkichenin/32/96679_2.png) [@lkichenin](https://forum.dynamobim.com/u/lkichenin)\
**Post date:** [December 18, 2019, 7:56am UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/9 "2019-12-18T07:56:43Z")

</div>

One way to do it is to normalize the depth of your “amended” list so you can perform the test. You will need to manage your lists accordingly to make it work.

Here is the illustration :

 ![List](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/f/6f65c771bafab23bd9efb017a9ea130a33beaacc.png)

---

<div class="post-metadata">

**Author:** ![jonas.blazinskas](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonas.blazinskas](https://forum.dynamobim.com/u/jonas.blazinskas)\
**Post date:** [December 18, 2019, 11:29am UTC](https://forum.dynamobim.com/t/replace-null-with-with-data-from-previous-node/44587/10 "2019-12-18T11:29:12Z")

</div>

Thank you, so much!
