--- title: "Check existence" slug: "core-exists-rule" updated: 2026-04-02T13:39:03Z published: 2026-04-02T13:39:03Z canonical: "docs.lobstersoftware.com/core-exists-rule" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Check existence Executes a [Search](/v1/docs/en/core-search) for entities of a certain **Class** on the **Lobster Data Platform/Orchestration** database and checks if it produces at least one match. A [Check existence](/v1/docs/en/core-exists-rule) rule executes a [Search](/v1/docs/en/core-search) for entities of a certain **Class** on the **Lobster Data Platform/Orchestration** database and checks if it produces at least one match. **IMPORTANT:** In a similar way to the [Search builder](/v1/docs/en/administration-system-search-builder), the search can only return entities of the class for which read access is granted in the context of the current session. **WARNING:** It is not recommended to use this type of rule in [Association criteria](/v1/docs/en/core-association-criteria) to avoid performance issues linked to frequent execution of the configured database searches. [Association criteria of type 'Logical component'](/v1/docs/en/core-association-criteria-logical-components) are exceptions to this rule, since they are only executed selectively, similar to validating rules of [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration) and therefore much less frequently. ![images/download/attachments/201665452/image-2025-3-27_10-43-52-version-1-modificationdate-1743068632927-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-27_10-43-52-version-1-modificationdate-1743068632927-api-v2.png) The definition of a search involves the following elements (see also [Search API](/v1/docs/en/common-search-api)): - The selection of a **Class** defines the type of entity so search for. - Entities of other types may be included in the search via [Joins](/v1/docs/en/core-abstract-join), if required. - The **Where** condition defines [Restrictions](/v1/docs/en/core-i-search-restriction) for the search, based on properties of any involved entity type. **NOTE:** [Projections](/v1/docs/en/core-i-search-projection) configured to define in the **Restriction** refer to the searched class and not to the currently valid input object in the context of the [Check existence](/v1/docs/en/core-exists-rule). If the **Restriction** is supposed to include data from this context, it can be accessed via the [Variable](/v1/docs/en/core-storage-value) `entity`. Of course, other variables can be included if needed, to include 'more remote' contexts, if needed (beyond a [For each loop](/v1/docs/en/core-for-each-entity-actor)) or an [Execute with](/v1/docs/en/core-with-actor) event action). Configuration example: The **Validating rule** of an event handler should trigger certain event actions if the [Company of session](/v1/docs/en/base-session-company-account-value) owns inactive user accounts. ![images/download/attachments/201665452/image-2025-3-27_10-42-3-version-1-modificationdate-1743068523201-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-27_10-42-3-version-1-modificationdate-1743068523201-api-v2.png) - This search refers to the **Class** 'User', without involving any [Joins](/v1/docs/en/core-abstract-join). - The **Where** condition defines a conjunction (AND) of two criteria: - The first [Field restriction](/v1/docs/en/core-property-search) accepts users whose 'Owner' (`ownerId`) matches the ID (`id`) of the [Company of session](/v1/docs/en/base-session-company-account-value). - The second [Field restriction](/v1/docs/en/core-property-search) accepts users for which the flag 'Active' (`active`) is unchecked (`false`). This rule is passed if the intersection of both [Restrictions](/v1/docs/en/core-i-search-restriction) is not empty. In that case, event actions might produce a warning message or open a certain view, featuring details of inactive users.