Count entities in When section of Rules

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

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

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

4 Likes

Truer words were never spoken.

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.

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

1 Like