[NEXT] References Fields with Filter

Hi Sebastian,

It would be nice to add filters to these fields when adding reference fields to schemas. While showing the data in the panel, we sometimes need to filter and show them.

it looks like we have a minor UI issue to do this because we can give multiple schemas as reference.

I have uploaded a simple screenshot to explain the idea in my mind. A more accurate usage scenario can be created by developing this idea.

So you are not allowed to add other references that do not match the condition?

I should actually be able to add filters for each schema mapped. It may be necessary to make minor changes to the interface for this. Since I didn’t know how to reflect this in the UI, it seemed as if the filter would be valid for all schemes.

What I meant: Is it just a UI filter or a validation rule? Must the filter be applied when validating entities?

I can only imagine this at the UI level, so filtering at the point of adding the reference. Making it part of validation would add complexity around what to do when:

  • The filter changes so some references already saved no longer match that filter
  • The value of a field being filtered on changes so that it no longer matches that filter

Assuming those operations aren’t blocked it would leave the content in an invalid state that would come up when you next try to edit it for example.

1 Like

For now, it seems more correct to have it only in the UI. Improvements can be made according to the needs in the following processes.

Then it would be the editing tab…

1 Like