Creating standard field in entity that "Self References" that entity?

To get around the current limitations of auto-relations and not having formulas in filters, I’m trying to create a formula field that will just self-reference the entity it’s associated to.

I was hoping to just be able to use the [This Entity] field in the formula, but it only seems to work inside of a filter function.

Also, because formulas can only reference fields related to the entity they’re in, and not all the databases in Fibery, I can’t just do:

Filter([Public Id] = [This Entity].[Public Id])
  .Sort()
  .First()

I know I can do this by referencing the other relations that an entity may have, but I’m trying to create a standard field I can easily add to all databases that doesn’t need to be customized each time.

Is there any clean and simple way to do this?

Not sure I get what you want to achieve.
Do you want to have a field in an entity, which returns the entity itself?
Why?

Exactly!

There’s several Fibery limitations I’m trying to work around:
1a. Not having any way to have filtering/conditional logic when auto-linking
1b. Not being able to auto-link using many-to-many fields
2a. Not having formulas in filters. Specifically automation filters in this case.
2b. Not having branching logic in automation rules.

Maybe if I knew how to script things, it would make things easier for me, but I don’t so I have to rely on more traditional methods like formulas and automations which get very exhaustive to build and maintain.

Here’s a common scenario that we struggle to handle without having many, many separate automations that can be complex and sometimes unreliable. Using a self referencing field, I’ve been able to simplify everything into a single automation now, which is awesome, and now I’m trying to scale that approach to be able to streamline many other automations I have as well.

Relational Hierarchy:
[Iteration] M-M [Sprint]
[Iteration] M-M [Team]
[Team] 1-M [Sprint]

Ideal Logic:
WHEN
[Iteration].[Week Number] = [Sprint].[Week Number]
AND
[Iteration].[Year] = [Sprint].[Year]
AND
[Iteration].[Teams] is any of [Sprint].[Team] (Team A, for example)
LINK
[Iteration] to Team A’s [Sprint]

and if any of the conditions are no longer met, UNLINK the iteration from the sprint.

You helped me with a similar scenario in another thread before if it seems familiar Contains equivalent? - #12 by Chr1sG

1 Like

If Iteration M-M Team and Sprint M-1 Team then I don’t understand what

can mean.

Do you mean Iteration.Teams contains Sprint.Team?

Yeah, contains is what I meant.

An iteration could have Team A and Team B working on it, so in that case it would need to show up in both the Team A Sprint and the Team B Sprint.

In the case only 1 team is working on a particular iteration, it would only be linked to the sprint for that team, for that time period.

If I understand it correctly, here’s how you can do it:

Use an auto-relation to link Iterations to Sprints based on them having matching Week and Year (a.k.a. simultaneous):

Add a formula on the Iteration db to get a list of its Team IDs:
Teams.Join("[" + [Public Id] + "]", " ")

Now you can use a formula on the Iteration db to find which of the simultaneous Sprints are owned by a Team whose ID is in the Team ID list:

[Simultaneous Sprints].Filter(Find([This Iteration].[Team IDs], "[" + Team.[Public Id] + "]") > 0)

And you can do the opposite on the Sprint db:

[Simultaneous Iterations].Filter(Find([Team IDs],"["+[This Sprint].Team.[Public Id]+"]")>0)

Did I get anywhere close?