How do I establish relations between existing tables

Good afternoon

After 35 years of marriage with Filemaker we filed for divorce and i found myself a new friend.

She is a bit unwilling
She doesn’t seem to understand the most simple things I want

Making a relationship between two fields, which in my old marriage was a case of drag and drop.
I see explained how to make a link from a NEW field, but how to do this from existing tables and fields?

:laughing:

If the relation already exists between tables on that database - we automatically identify the relation. If not I’ve created an issue to make things happens between us :laughing:

PS : we did discuss this problem just yesterday internally.

I don’t know what you are trying to tell me here.
Who is “we” and who are “us”???
And what you mean with these emoticons?

So let me explain my problem

I Have started today with NocoDB after working with Filemaker since 1986

I have started with importing four tables from a very simple DB in an attempt to try to understand the workflow of NocoDB.

HOW do I set relations between fields in two tables if these tables and fields already exist?
Is this possible?

Does the relationship between these table already exists ?

How does your table look like - giving two options below

  1. country (id, title) and city (id, title, country_id)
  2. country (id, title) and city (id, title)

If its like option 2. You go to country table and create a new column of type ‘links’ and choose has-many as the relationship type. It will automatically create the country_id in the city table.

If its option 1 : then the newly created issue that I pointed needs to be implemented within NocoDB.

Happy to clarify - pls provide an example.

There are four tables in the DB.
There is no relation yet. But the tables are already filled with data
I am trying to make a “one to many” relation between 2 existing fields in existing tables

Sorry then - as mentioned above its currently not possible. As a work around - you can create the foreign key relationship between those four tables on the actual database. And do a metadata sync - that should work.

hmmmm… bummer.

So… if you’ve got data already in a field you can not make a relationship?

Another question.
What I did today was: import data and let NocoDB make the tables.
What if I do it the other way around?

Create the table (with the linked fields and THEN import data?

Yes, the proposed way of bringing in the data after linking should work.

Okay, if this is the proposed way…
Please explain how.

I can only import into the project, which creates a new table.
How do I import into an existing table?

You can see here on how to import data into existing table.

Oh, I see!
Thank you so far!

Is this the same question is this one:
Update relationships from CSV or Excel [May 15] ?

How do I interpret the status of this issue:

I dont know Github well enough but I guess its on the issue board?
But having a hard time understanding if its on hold or open or just gone, I cant find it on the issue board anymore?

Background: I have 10 years of data in a closed source Android app (Sailforms) with around 70 tables exported to csv, but some tables function as ‘pick-list’ or ‘filter’ values for other tables. My intention is to import the tables and then establish relationships between them one-by-one.

The feature request in github that you are referring to - has not been picked up yet unfortunately, but it is in our roadmap for next quarter.

For now, you will have to rely on building a script using our APIs to make this happen
https://data-apis-v2.nocodb.com/#tag/Table-Records/operation/db-data-table-row-nested-link

1 Like

Ah thnx, I will be patient then, Nocodb has much to offer compared to a local Android app and for long term I want something more open also.

How did you solve it?

You will have to create relation within your database and then do a meta sync/.