Parent - child connections to same object. Need some guidance

Hi, I looked but couldn’t find this anywhere, so here goes …

I have an object called COMPANY

I want to be able to define a hierarchy of companies, where any company may have one parent, and therefore a company may have many subsidiaries. I believe the way to achieve this is to create a self-referential CONNECTION from COMPANY to COMPANY.

That I can do, but my problem is that I cant work out how to make this work the way I need it to work:

I want to connect the SUBSIDIARY to the PARENT. i.e. when I create a new company, I want to select the parent from a list - thus establishing the subsidiary-parent connection.

What I DONT WANT is to connect the PARENT to the SUBSIDIARY. Doing it that way means every time I create a new subsidiary (like another branch office opens) I would need to edit the parent to connect the subsidiary to it. And of course, people will forget to do that and it all falls apart.

I have set up a connection from Company to Company and called it PARENT COMPANY, and that works, sort of. It gets populated while editing/creating the subsidiary. And the selected company is shown as the parent when viewing the subsidiary.

But I can find no way to display a list of the subsidiaries when viewing the parent company. I would have thought a simple grid of "This grid displays COMPANY records connected to this page’s COMPANY " would do the job. But it remains stubbornly blank when viewing the parent company. When viewing the subsidiary company, it shows the parent. Its like the connection is only recognized from the subsidiary to parent direction, but not in the parent to subsidiary direction

If this was a connection between two different objects the solution is obvious - define the connection in the other object! But I cant do that with a connection to the same object.

I have tried every combination of 1 to Many, Many to 1, 1 to 1, and Many to Many, and none of them work.

Does anyone know how I can achieve this, or if its possible at all?

Is this what you mean?

Right idea, but instead of describing the childen i am seeking to describe the parent.

You have the relationship described on the parent row which means in the live app i would need to edit the parent company record to nominate its children. Which I’m trying to avoid.

I am hoping to name the parent in the child company record so it can be chosen in the live app while editing that child record.

Then in live app while viewing the details of the parent record, i would like append a grid to show all companies who have this company chosen as its parent (i.e a list all its children)

So on the table it would be showing the name of the parent company in that connection column (on the child row), not the child companies on the parent row.

I’m on mobile right now but tonight I’ll pull together an example of what i mean.

So this is what Im trying to do:

Ive set this up this way so the parent is described in the child records.

I then need to have an ability to have a “display record details” page where I view the parent record details and add a grid view showing all the child records linked to it. When creating that grid, Knack doesn’t give me any viable option that will list those children companies when viewing the details of the parent company. The connection seems reversed - it lists the parent when viewing the child records but is blank when viewing the parent record. So I concluded this is a dead end.

As an alternative, I’ve also tried having a second “hidden” children column, hoping I could then populate it by appending the child company into that “connected record” field using a related record rule, but there doesn’t seem to be a way to do that either because you can’t append a field using a related record rule, you can only overwrite it.

So I’m a bit stuck. My next step is to create a second table called relationships and work from there, but that sort of defeats the value of having connected records and I’m not sure that will work either, to be honest.

Ok, I worked out how to achieve what I need with a second object called Relationships, that just has two connection fields called PARENT and CHILD, and populating that object with a related record rule when any company is created or edited with a PARENT company. Case closed.

But if you do find a way to do it all within the one COMPANY object I’d love to know how.