Search for objects that have a list of a certain length / number of elements

I’m trying to do a search for all objects of type “Customer” who have more than one “Transaction” elements in their field that is a list of things. Example I want to Return all Customers where Customers.Transactions.Count > 1.

This seems simple so I was surprised when searching for or filtering and adding a constraint for field “Transactions” my only options are “contains” “doesn’t contain” “is empty” “isn’t empty”, and I don’t see any way to refer to the number of elements being stored in that list.

I’m sure there is a simple solution to this I am overlooking but I thought I could ask and get some help about it since I can’t figure it out.

Thanks!

If Transaction is a separate DT that you’ve linked to a customer DT as a list,

Customers.Transactions.Count > 1.

This should work I guess

You’re right—it seems simple, but Bubble doesn’t provide a direct “count > X” filter in searches. However, you can achieve this with the :filtered operator. Here’s how: Search for Customers (Do a Search for Customer). Use :filtered → Add a constraint: Advanced: This Customer’s Transactions:count > 1. Bubble’s search constraints don’t support counting directly, but :filtered lets you apply an advanced condition after retrieving data. Keep in mind that :filtered runs client-side, so if you’re dealing with large datasets, consider restructuring your database for performance.

1 Like

Thank you, this is the answer I was looking for!