Relate with self

Is it possible to create a relation with self, filter for a certain condition and display as in inline/list relation in a specific style?

I’m trying to show ratings for a service. The ratings are logged together within the service in a single table. I can relate to itself but the filter option is missing and the style is inherited from the parent service.

Yes, I do that a lot. The trick is to create two template columns:

  • the first concatenates the columns that you want to filter on
  • the second concatenates the specific values from those columns that you want to use as filters
  • then you create a multi-relation that joins those two columns
5 Likes

Yep! What he said👆

rel_self is a common column type in my apps :nerd_face:

4 Likes

But in two different tables or in the same one? Which are the use cases of rel_self?

Thanks for your quick replies, that works great as a filter but when I’m trying to display the results as relations item the view is inherited from the parent item and cannot be edited without affecting the other.

Either/or. rel-self is by definition linking a table to itself, but the same technique can be used for linking two different tables. I like it because it means the filtering logic is kept in the GDE, and it quite often means you don’t need to apply any filtering conditions to the inline list components (which can very quickly become complex and unwieldy).

1 Like

hmm yes, I think I get what you mean, and I don’t have an immediate good answer. It’s something I’d need to experiment with.

It appears that relation items cannot be used in this case. Buttons and action text with a link screen to the self relation are possible work around. Nonetheless, one step further - thank you!