# Clearing number or datetime fields sets value to null instead of empty

**URL:** <https://community.appfarm.io/t/clearing-number-or-datetime-fields-sets-value-to-null-instead-of-empty/1632>\
**Category:** Bug reports\
**Created:** [February 11, 2025, 1:18pm UTC](https://community.appfarm.io/t/clearing-number-or-datetime-fields-sets-value-to-null-instead-of-empty/1632 "2025-02-11T13:18:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_sivert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/_sivert/32/1484_2.png) [@\_sivert](https://community.appfarm.io/u/_sivert)\
**Post date:** [February 11, 2025, 1:18pm UTC](https://community.appfarm.io/t/clearing-number-or-datetime-fields-sets-value-to-null-instead-of-empty/1632/1 "2025-02-11T13:18:30Z")

</div>

When clearing an input field for a **number** or **datetime** property, the value becomes `null` instead of simply being empty. This is different from **string** properties, which correctly become empty when cleared. The issue occurs regardless of the input field type (even if it’s set to `"text"`), so it’s seems to be tied to how data types are handled rather than the input type itself. This causes unintended overwrites with `null` values. Please let me know if you have any questions:)

For context, this causes problems due to a workaround solution we implemented some time back: [Iterating object properties](https://community.appfarm.io/t/iterating-object-properties/1577). When data binding the fields, null properties will overwrite existing valid properties. Tips on a workaround for this, like a update-only-if-property-is-not-null is very much apricated.

---

<div class="post-metadata">

**Author:** ![danielhansen](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/danielhansen/32/371_2.png) [@danielhansen](https://community.appfarm.io/u/danielhansen)\
**Post date:** [February 13, 2025, 1:13pm UTC](https://community.appfarm.io/t/clearing-number-or-datetime-fields-sets-value-to-null-instead-of-empty/1632/2 "2025-02-13T13:13:08Z")

</div>

@ErikAKSkallevold You suggested today that we return `undefined` to change properties to `undefined` rather than `null`. However, we don’t see a way to actually do this, as no function in Appfarm can update data directly. Therefore, you need to write it in an update action as a function. But if you return `undefined`, it will ignore the “value” since it is `undefined`.

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [February 13, 2025, 4:52pm UTC](https://community.appfarm.io/t/clearing-number-or-datetime-fields-sets-value-to-null-instead-of-empty/1632/3 "2025-02-13T16:52:47Z")

</div>

Yup, seems I was mistaken on that part.  
You are correct, undefined values are filtered when updating objects.

// Erik
