[dummy title body text appended to avoid empty title body]
IvanDrago replied
I have a database with two tables with a large amount of rows each. I’d like to add a LinkToAnotherRecord column from one to the other so that I can create a few other lookup columns. Instead of adding them manually, is there a way to import an CSV or Excel file that has the values that I need to link?
wkw replied
you may take a look if this s your case. if u hv the existing project, n u want to have a lookup
https://docs.nocodb.com/setup-and-usages/lookup#lookup
IvanDrago replied
That’s what I want to do, however, it’s my understanding that before I can do that I have to do a Link To Another Record (https://docs.nocodb.com/setup-and-usages/link-to-another-record/)
wkw replied
If your existing DB has the corresponding relations, then nocodb will create LinkToAnotherRecord column.
wkw replied
if u already hv a nocodb project, I’d suggest u to add it manually n it ll get the corresponding data
IvanDrago replied
The DB doesn’t have them. Before I went ahead and did anything I wanted to see if Nocodb can do it.
I’ve tried importing an Excel spreadsheet and setting that column to LinkToAnotherRecord but when I do that Nocodb imports the column as blank. I wasn’t sure if I was doing something wrong.
wkw replied
before importing an excel, u can fine tune the column to choose the column type. hv u done that ?
wkw replied
besides, adding LinkToAnotherRecord in GUI directly seems the easiest way to do it. any concern for this approach?
IvanDrago replied
I’ve done that. To double check myself, I’m trying to replicate the example shown here:
https://docs.nocodb.com/setup-and-usages/link-to-another-record/
I’ve downloaded the following CSV file:
https://raw.githubusercontent.com/icyrockcom/country-capitals/master/data/country-list.csv
So now I have a table called “Countries” with just the country list and a table called “Capitals” with just the capitals list.
Then, in the “Countries” table I’ve created a LinkToAnotherRecord column with a “Has Many” relationship pointing to the “Capitals” table.
Both of the new columns are blank. My question is, instead of populating the columns by hand, can I do that automatically by importing a CSV or similar? When I try to upload a CSV to the table by clicking on “More” => “Upload CSV”, the new relationship table doesn’t show up.