# Array type "empty\_values" cannot remove all empty values

**URL:** <https://forum.elixirforum.com/t/array-type-empty-values-cannot-remove-all-empty-values/63330>\
**Category:** Questions\
**Tags:** ash\
**Created:** [May 5, 2024, 11:31am UTC](https://forum.elixirforum.com/t/array-type-empty-values-cannot-remove-all-empty-values/63330 "2024-05-05T11:31:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sheerlox](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sheerlox/32/36437_2.png) [@sheerlox](https://forum.elixirforum.com/u/sheerlox)\
**Post date:** [May 5, 2024, 12:38pm UTC](https://forum.elixirforum.com/t/array-type-empty-values-cannot-remove-all-empty-values/63330/3 "2024-05-05T12:38:59Z")

</div>

Adding a `remove_nil_items?` constraint should be pretty straightforward.

But now that you mention it, it’s also unexcepted behavior that `nil` values make it through to the database if they are initially empty strings.

To circumvent that issue, I guess the `is_nil` check would benefit from being rerun after applying the item’s type constraints here:

[https://github.com/ash-project/ash/blob/v2.21.14/lib/ash/type/type.ex#L704-L713](https://github.com/ash-project/ash/blob/v2.21.14/lib/ash/type/type.ex#L704-L713)

But that would probably be considered a breaking change, right?

Maybe we should continue that discussion in a GitHub issue or draft PR, let me know!

---

_[View the full topic](https://forum.elixirforum.com/t/array-type-empty-values-cannot-remove-all-empty-values/63330)._
