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.