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

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. 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.

1 Like

@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.

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

// Erik