Hello!
.
I’ve created a Lookup field on a Meeting entity I have (the lookup is from tasks related to the group responsible for that meeting) but the tasks appear sorted in a kinda confusing way. I can rearrange them manually, but I’d like to know if there’s a way to set up the sort, just like in the views. Also if there’s a way to filter, so I can see only the tasks that haven’t been done yet…
Sorting and filtering is available on relation views, but not on formulas/lookups.
If there is a single group linked to the meeting, and if a task belongs to only one group, then you could use an automatic relation rather than a lookup (matching on group) and then sorting/filtering becomes available.
The problem is that the sort is not respected in the field’s UI. But of course the formula itself does return it sorted, as we can confirm if we return the value as a joined text field by adding .Join(Contact.Name, ",").
The Sort() function in formulas is not related to the sorting that is used when displaying collections.
It is typically used for when you want to extract the First() or Last(), or do something like Join() as you discovered.
But formulas utilise ‘backend’ functions, and they do not affect the ‘frontend’ display of the result.
Ultimately, the fix will come when it is possible to use the standard relation field component to display a collection of entities which are the result of a formula.
See here.
In that case, users will be able to set frontend filters and sorting on collections which are read-only.