Some time ago I posted a similar question in this forum, [here]( Reciprocal relationships (or connections) - Tadabase Community). I don’t think I asked the question very well and I didn’t stick with it, so that in the end I didn’t really achieve the enlightenment I sought.
So I’m going to take another stab at it.
In the relational database management systems I’m most familiar with (including FileMaker, 4D, and even Airtable) a connection or “link” (Airtable) or “relationship” (FileMaker) is always inherently a two-way street. If you link, say, Projects to Tasks (typically by connecting ID in the Projects table to ProjectID in the Tasks table), then the infrastructure is there that will allow you to view linked child tasks from a project record, or to view details about the parent project record from any task. In Airtable, if you create a link from Projects to Tasks, then switch to the Tasks table, you will find that a reciprocal link has automatically been created for you from Tasks to Projects.
As far as I can tell, this is simply NOT the way that Tadabase works. And for me it’s been one of the biggest stumbling blocks about Tadabase, which is many many other ways I like much more than Airtable.
So my question is: Am I missing something? Or is this just the way it is in Tadabase? Is it really the case that, if I want Projects to be linked to Tasks and I want to see linked (connected) records from both sides of the relationship, I have to define the connection in both ways? If I am missing something, what am I missing?
Here’s a video that hopefully helps explain how Tadabase manages connections
About connections (relationships) in Tadabase.
Thank you so much for the video! The key bit of info for me comes right around 1:50. You’re adding a table component to show Tasks to the Projects page. A dialog comes up that asks “Which records should this table display?” And the first of the options is “Records connected to this Project.” I’ve seen and used this option before (before I took my hiatus this year from Tadabase) but it never clicked with me that this option has appeared without any input from me, that is, without me having to define a Project-to-Table (parent-to-child) connection in the Projects table.
Has clicked now, thanks for your video. Big bright light bulb has come on. Many thanks.
So for the benefit of others who might have the same question, here’s the quick summary of my understanding right now:
- Until you get to Enlightenment Level 2, simply take it as a Best Practice to define the connection between a parent (ONE) table and a child (MANY) table IN THE CHILD (MANY) TABLE. To return to my example, that means if you’re creating a To-Do app with tables Projects and Tasks and assuming that each task can only be connected to one project, you should go in the Data Builder to the Tasks table and create your connection to Projects there. Be sure to specify that each task can connect to only one project!
Do not create a reciprocal connection from the parent/one table to the child/many table! Just leave the parent table alone. You won’t be able to see connected values in the Data Builder, but you can look at the ER diagram to confirm that the link has been made.
- Now when you go to create pages for these tables, on a detail page for a task record, because “LinkedProject” (my name for this field) has been defined as a field in Tasks table, you can just add it to your detail page or add/edit form page.
- And on a project detail page, you can add a component table that shows “Tasks connected to this Project”. The option magically appears there.
NOTE also that linking child records to the parent table also makes it possible to create a field in the parent table that counts the child records. Once the connection from the child table has been defined, you just create a field of type “Count” in the parent table. This is a kind of formula field and the options — the things this field can count — will be displayed, including the linked child records. So again: I have a CountLinkedTasks field in my Projects table even though I did not define a connection from Projects to Tasks.
This basic info will allow me to get started on the projects I want to do in Tadabase right now, and that’s brilliant. Very grateful to Tim for the explanation. But now that I’ve grokked this bit, I’m starting to wonder about other important things.
- What’s the use case that justifies creating the connection from the perspective of the parent (one) table? I should note that I played with this and discovered that in this case I couldn’t figure out how to see what project a task was linked to.
- What happens if I do (even accidentally) create an explicit connection between two tables from both sides of the connection? That is, what happens if I add a connection field in Projects that links to Tasks; and then create a connection field in Tasks that links to projects?
I asked this in my last comment above but that was a long response and this question at the end might have gotten lost. But I’d really like to know the answer to this one question in particular so hoping that posting this by itself will help…
I’m not an expert, but have pondered similar issues. So I though I would interject. When I first encountered Tadabase I was struck by the ease and fluidity of creating tables and views etc.
But Iwondered how to connect the tables. It has taken me a while to realise the differences from other relational databases I have used.
My observation of Tadabase connections is that they are one-directional and hierarchical. From tertiary to secondary to primary tables. And they are optional, in that a field is never connected, its a record that is connected but only if it has connected value.
In practice this works really well, for relatively simple apps. Where I have come unstuck before is the case when you want data to transverse the hierarchy. For example, if you wanted to apply ‘users’ to tasks. You would create a connection in Tasks to Users. And those same users can work on tasks in a number of projects.
And then you want to go to the Users table and create a view showing the tasks for each of them - You can’t. There is no connection in that direction … But you can create one, and it can be updated by a Pipe when ever the Tasks table is updated.
I hope this makes sense, and is factually correct. As these are my working assumptions, and how I get things to work.