Automating the links

Hello, friends. I have two tables. The first one is with factories (30 rows) and the second one is with brands (2243 rows). There is a relationship from many to many between the tables. I need to link 1 factory to 2243 brands. Is there any way how this can be done without linking them manually (by clicking 2243 times in the interface)?

To understand it better - you want to link two columns which are not primary keys (i.e they do not have an ID) but based on the value (read mostly string) that are in two columns ?

At the moment its not possible - we 've a feature request open in github.

Hey ther YouGin,

I think I know how to fix your problem.

You will need to first show the many to many tables in your base. Click on the three dot button next to your base name and check the option as the following picture:

Next, open the desired M2M table.

Here in this table you can see that there are 4 columns available. But there are actually two columns available if you access this table via an sql viewer app like TablePlus.

What you will want to do to connect 1 factory to 2243 brands is the following:

  1. create a csv or excel file with two columns.
  2. in the first column write down the id of the 1 factory you want to make the relation to
  3. in the second column write down the ids of the 2243 brands (download the ids of the brands table as excel file)

you will have two columns with the first row as the header like (table1_id, table2_id) and 2243 rows in the following. In the first column is the id of the factory and in the second column is the ids of the 2243 brands.

Now what you will do is that you will import this csv or excel file into the M2M table. In the process, choose the appropriate columns in the destination table.

This method should work for you. Let me know if you have any problems regarding this. I’m available. we could have a video call via google meet if necessary.

Regards,
Zachary