# Count entities in When section of Rules

**URL:** <https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776>\
**Category:** Ideas & Features\
**Created:** [November 12, 2024, 8:33pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776 "2024-11-12T20:33:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wilco\_Boode](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/wilco_boode/32/9985_2.png) [@Wilco\_Boode](https://community.fibery.io/u/Wilco_Boode)\
**Post date:** [November 12, 2024, 8:33pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/1 "2024-11-12T20:33:40Z")

</div>

It is currently not possible to run automations based on entity counts in a relations field. It would be great if we can run this check, as it currently requires either a Custom script, or a Formula in the 'Then" section

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [November 12, 2024, 8:46pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/2 "2024-11-12T20:46:27Z")

</div>

Can you explain what the use case is?  
I wonder if it can be solved with 'Entity linked to … ’ trigger

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [November 12, 2024, 10:17pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/3 "2024-11-12T22:17:02Z")

</div>

Ultimately it would solve a lot of limitations if Rule filters could be Formulas 😉

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [November 14, 2024, 2:05pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/4 "2024-11-14T14:05:56Z")

</div>

Truer words were never spoken.

---

<div class="post-metadata">

**Author:** ![Wilco\_Boode](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/wilco_boode/32/9985_2.png) [@Wilco\_Boode](https://community.fibery.io/u/Wilco_Boode)\
**Post date:** [November 14, 2024, 2:39pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/5 "2024-11-14T14:39:02Z")

</div>

One example:

We are building our booking system, and one type of bookable items is a lab space. People dont need to return this, while they do need to return any other item. That means that if we run a check (daily / weekly) for overdue bookings, that we want to automatically close any bookings that ONLY contain a lab space. Currently we can check if the relation contains one of these rooms, but we cannot check if that relation ONLY contains that room. Meaning that we cannot assume that people didn’t book any equipment alongside the room that we need to check.

Having a count option would help to call for more specific Rules that dont need to trigger as many actions.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [November 14, 2024, 3:44pm UTC](https://community.fibery.io/t/count-entities-in-when-section-of-rules/7776/6 "2024-11-14T15:44:28Z")

</div>

Yeah, for the time being, the only solution is to create a formula field in the database, and then use that field in your rule filter
