Is it possible to return a number that represent the index of an entity.
Example:
– Child, 001
– Child, 002
– Child, 003
I’ve read though the docs, but couldn’t find anything that seemed relevant.
Real world examples:
Invoice sequence number
Client status updates
Purchase order numbers
Any kind of identifier on a per something basis
The motivation for this, is we are seeing that users struggle to link the correct entity / name an entity with enough detail, so in some cases it makes more sense to use an automatically generated name.
When you say ‘the index of an entity’, what do you mean?
Is it a number field that a user will manually set?
Or is it the public ID?
Or is it a number from a consecutive sequence determined based creation date order?
Or…?
So, just to keep it abstract enough that i understand the problem, you might have Parent A and Parent B, each with child entities.
And you want to be able to define a field in the child entity that reflects the order in which it was created amongst the child entities with the same parent right?
But what happens if the order of entities within the parent collection changes? Entities might be inserted or deleted. Or if an entity gets moved from one collection to another, or added to multiple collections…
You probably don’t want the entity name to change, so the entity name can’t really reflect its “index” position within a particular collection.
If you really want a “serial number” effect, it must be independent of any collection. It is not difficult to make a unique number (e.g. from the entity creation time), but to make sequential integers is more difficult. That would require storing the last-used value somewhere and incrementing it each time a new entity is created. It would require a script.
As a general aside - Using a formula for the name is powerful, but it would be incredible to be able to combine both the user inputted data and the power of the formula.
As I think @Chr1sG mentioned this can work; you just need a separate user-editable field to hold the user-defined value, which the Name formula incorporates.
I do this when, for example, I want a Task Name to include the Client Name as well. I create a “Title” text field, and the entity Name field is a formula that combines it with other info, like so:
But in this scenario how do you feel about the experience when creating an entity? Are you using some sort of table view that is dedicated to this data entry?
Let’s take adding a task, it’s not possible to name the task whilst creating it, as entry is disabled when the name is set using a formula.
Indeed it is a kludge. A more ideal solution would allow us us flexibly and dynamically prompt the user for just the necessary info when creating an entity, as here: Ask User Input for Rules
it would be very useful to be able to prompt the user for more info situations like this, to save them from having to explicitly open the new entity and navigate through all its fields to find the ones that should be set. It is much more efficient if the user is simply presented with all the fields that need to be set.