Using References in a formula

Has anybody used References in a formula field? I’m experimenting to see if there’s any way I can create a field that returns all the items of a specific type that refer to the entity.
For example, entity #1 of type A mentions entity #2, and entity #3 of type B also mentions entity #2. Can I write a formula for entity #2 that returns only those referring entities that are of type A (so it would only show entity #1)?

To be honest, we haven’t paid much attention to using References in formulas.

Our own main use case is prioritzing Features based on the number of latest use cases:

References.Filter(FromEntityType.Name = "Customer Success/Conversation" and [Creation Date] >= Today() - Days(90)).Count()

At the moment, there is no way to extract a list of entities of a certain Type from the References but we will consider this. Meanwhile, the best you can do is to narrow References down to entities of a particular Type:

References.Filter(FromEntityType.Name = "Test/Task")

Here’s an example:

If you stumble upon new scenarios of using References, please do not hesitate to share them — we watch closely and take notes :writing_hand:

Thanks for that.
I have a use case whereby I have created standard operating procedures (‘SOP’ entities) that contain a rich text field with instructions/rules for activities and which roles are responsible for them, e.g. The R&D_Manager shall keep a record of all employees vacation
[R&D_Manager is a #reference to a ‘Role’ entity].

When users are assigned to a specific role, I want to make it totally transparent to them what they are responsible for. If I can add a field ‘Relevant_SOPs’ to the ‘Role’ type which contains a list of references, filtered to only show those of the type ‘SOP’, I can then add a field for users which is a lookup to Role.Relevant_SOPs. Every user gets a customised list of SOPs they need to read.

Thanks for the use case!

Back-references are ideal for unexpected connections — which is not the case here. From the data modeling perspective, it seems like a Rule/Instruction could be a separate Type:

Not sure about the UX though — have a couple of questions:

  1. How long are the instructions usually?
  2. Are there people who read instructions for all roles for a particular SOP?

Thanks for the suggestion. It had crossed my mind to do that, but I had decided against it for a couple of reasons:

  • I want the person who has a specific role to understand the expectations of their role in the greater context of the procedure. In other words, it’s important that the person reads the entire contents of the SOP, not just the specific instructions that they should follow.
  • The ability to write instructions with #Role references is really useful for the author of the SOP. It’s so much more intuitive that writing an instruction and then remembering to create a link to a role entity.

Got you, that makes a ton of sense. There is no nice solution at the moment but we’ll watch closely for the similar use cases and will try to come up with a decent solution :slight_smile:

Just out of interest, would it be possible to write an action button script to extract all references of a specific type, and add them to a relationship field collection?

Yep, you can do it right now with some coding — nice idea!