I tend to use entity relations instead of single-select fields (because i cannot figure out how to use them in formulas). For instance, i want to assign priorities to Tasks and i do that with a one-to-many Priority-to-Contact relation, which works well, albeit a bit cumbersome to use in formulas with the Priority.Filter().Sort().First() expression.
Since there’s a logical order to the different priorities, it would be nice if they could be sorted by public ID instead of lexical order when i select a priority for a Task in its Priority field. I would really like to avoid prefixing the priorities with 1, 2, 3… since it is ugly.
I would like there to be an way to implement a categorization field for entities in DB that is easy to reference in a formula. I mean, the categories should be formula-accessible as Category.Name or Category[index]. Also, they should appear in logical order in the selection drop-down list, rather than alphabetical order.
Going into single-select fields, I have learned from this forum that single-select fields are actually obfuscated entities, but i have found no single example of how to actually use them in a formula. Say i have an if() automation for Contacts that should return the single-select field value “Tier 1” on true and “Tier 2” on false, how do i reference them in the formula?
Select fields act like types, so if you want to reference them in a formula, you need to reference a field, like Name.
If I have a database called DB, with a select field called Select, then in a formula, I can get the chosen Select for a given DB entity using the formula Select.Name
And when you say
then it should be the case that the possible options for select drop-down are returned in the order in which they have been configured (not alphabetical order).
You can rearrange the order using the ‘handle’ →
I’m not sure I understand what you’re trying to achieve here. Do you mean that you want to be able to set the value of a select field using an automation?
If so, then you’ll want to read this:
The issue of logical order does not concern single-select fields. Say i have an Ideas DB and a Category DB with a many-to-one relation. When i manually select a Category for an Idea, the drop-down list is in alphabetical order. I would like them appear in the logical order in which i defined them, e.g. their public id.
Edit 2: and the reason i set Priorities as an Entity is because i want to be able to set priorities by automations, which i cannot do with single-select fields.
\m/
I think the best solution would be to have somewhere to define, for each DB, how its entities should be sorted in relation-field pick-lists. The most obvious choices are:
by Name alphabetically
by internal Rank (as manually ordered in a List view)
In addition to the filter and sort in relation field option.
I found out that by default there is a sorting on the relational database field (Name ascending).
We use these relational databases for different purposes, for example, for priorities and lead status. In every database where I relate to this priorities database I have to take off the default sorting. We do not want it sorted by alphabet, but by order in the database. So in most cases we don’t need any sorting at all.
Now I don’t know what the desired behavior of the sorting is for the other users. Perhaps I am the only one who does not like a default sorting, but wanted to at least pass this on.
Prior to the implementation of relation sorting, the options were always sorted in alphabetical name order. In order not to break this, when the sort options feature was made available, sorting alphabetically on name was automatically applied by default.
As you say, it can be removed if not appropriate (in which case, they will sort on ‘rank’).
Fyi, sorting on public Id is almost effectively the same as sorting on Creation Date