Linking one record to 100 records on an other table


#1

Hello AirTable team,

I’m using airtable to do some product pricing with complex formula and links between tables.

I’m having an issue with linking tables and more specifically linking one to multiple records (i have been able to link them one by one by hand but i need to do mode than 5000 (50*100records) linking which is a hustle to do by hand) ) .

As an exemple :

I have 2 bases, the first (table1) with price references ( resale value) of each car and the second one (table 2) with complex formulas that let us update price based on the state of the car (second hand, engine, accessories …)

The first base (table1) is updated through the API straight from our website , and the second one (table2) is linked to our price estimation tool. But when i update the price reference on table 1, I want it to update automatically the 100 records on table 2.

To resume:

When I update a record on table 1, I want it to automatically update 100 records on table 2 (taking info from the record on table 1) without having to link records one by one (by hand).

Thanks a lot.
Casimir


#2

Maybe I’m missing something, but it sounds like all you need is a LookUp Field. Add a lookup field to Table 2, selecting the “price” field from Table 1 as the data source. Does that help?


#3

Hello @BenInDallas, it is Casimir (i’am on my collegue laptop).
Thanks for the reply,
I do use the LookUp fields but you can’t copy and paste in the cell all the ids I wan’t to link (around 100 for each).
The only way to do it, is by clicking the + button and select them one by one

The lookUp fields work perfectly but I cant be ask to clic on this button over 5000 times to set up all of them which would take forever.

I have been checking with the api, I found a way to do what i wanted but as the api is limited to 5 request per second it would also take quite some time.

I would be so much easier if you could select multiple entries or a group or a filter when you clic on the + sign.


#4

Hello again, after a good night of sleep I found out a way to do it with the api so I don’t have to clic 5000 times #hurrah

I put my little code just below for people in the future facing the same problem,
You just have to pass all ids in an array to the link field and it will work.

    base(`your_base`).update('Id_of_LinkedField', {
    "Name_of_RollupField":  ["id1",
            "id2",
            "id3",
            "id4",
             "id...."
            ],
    "updated": moment()
  }, function(err, record) {
      if (err) { console.error(err); return; }
      console.log('yo it worked yeah!!!');
  });