Provides a computed field type whose value depends on whether another field is empty or not. It presents a TRUE or FALSE result, which can optionally be set inverted.
Some use cases
- Search API indexing.
- Exposing empty/non-empty information about private fields through REST/JSON:API.
- Your very special case.
How to use it
Just like any other field module
A Field Is Empty field can be added and configured through the admin UI in the usual way. Its value will be recalculated whenever the parent entity is saved, and stored in the database.
As a computed base field
A field can be added programmatically to any entity type. This approach makes it a base field, available on all bundles of the entity type. See the example included in the project package.
As a computed bundle field
It is also possible to add a field programmatically to an entity bundle. This approach requires #2986836 to be merged or a patch applied (tested with this one). See the example that will be included in the project package once the core issue is closed.
Related core issues
- #2986836: Support computed bundle fields by adding the notion of computed field storage definitions It would let developers add a Field Is Empty field to a bundle rather than to an entity type.
- #2932273: Figure out how to implement configurable computed fields This one could potentially allow site builders to add computed fields through UI.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Site structure, Developer tools
- Created by dmitriy.trt on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.


