Filters looks very limited (at least for newbie)

Hello!

I am trying directus for my setup and it feels like I cannot do several basic things. I would appretiate you much for any tips and suggestions.

  1. Item from collection “profile” has O2M field “invoices”. How to set this field in admin panel to show only invoices that have paid==false ? I cannot find any “filters” in UI (see screnshot).

  2. I am strugling with filters syntax as well (in flow builder UI): is it possible to compare element’s field with another element’s field. Let’s say I want to do following for example: select all items from collection “profiles” that has field “current” bigger than field “limit” for more than 5? (I know that I could do it by passing all items to scrip at filtering them there, but it smells like dirty w/a).

1 Answer

1

@Alex_sf

For the O2M field in the admin panel, open the invoices field inside the profile collection, go to its Interface settings, and there you can define a filter (e.g., paid equals false) so only unpaid invoices are shown in the relation. Alternatively, you can create a global bookmark with that filter, so when selecting invoices it will only show unpaid ones.

Regarding Flow filters, the UI is a bit limited and doesn’t support comparing one field to another (like current > limit) directly. For that kind of logic, you’ll usually need a Run Script step or handle it at the database level (for example, using a view).

Thanks for reply! 1) Unfortunatly I cannot find that in UI (have attached screenshot to original post). Is existence of that filter depends on directus version ? 2) Understoodable. Is there any way to add view to DB in a "directus way", or should I use just direct DB access. Also I wondering how directus leaving with it ? Will this view field be safe if I decide to change other fields via UI?

For 1) That’s a bit weird, the filter option should normally be visible in the O2M field’s Interface settings. If it’s still not there, a custom extension or CSS override might be affecting the UI. For 2) I haven’t used views extensively in Directus, so I can’t speak from deep experience there. You could experiment with a small test setup first, or alternatively handle the logic with a script step to stay on the safe side.