Dec 14, 2021 03:50 PM
Hey there,
Assume a contact management base where we have a Contacts Table and a Companies table.
The Companies table has a Company Contacts linked record field that lists all contacts in that company.
When syncing both tables to another base, the Company Contacts linked record in the target base is displayed as a text field, not a linked record field and looses the linking between records.
Any plans for airtable to maintain the connection between linked records when both tables are synced to the same base?
When trying to recreate the link using a new linked record field and a script, I found out that the getCellValue method only returns the linked record name, and does not return the linked record id.
Any plans for the airtable scripts and blocks apis to return the record IDs of synced linked records, not only text?
My workaround, for now, will be to:
Add to both source tables a formula field that return the RECORD_ID().
Add a lookup field to the Companies table that displays the contact record ids
In the target base, use the synced record id fields in an automation to recreate the linked records in a new Company Contacts linked record field.
Anyone with a better solution?
Thanks,
Ronen
Apr 07, 2022 04:53 PM
Hi @Ronen_Babayoff , were you able to make this work? Thanks!
May 17, 2022 07:32 PM
Thank you, your workaround is working quite well for me! Though I would obviously also like to have this available out of the box.
Although I didn’t have to create a new formula field to return the record ID – it was selectable already in the Automation dropdown.
Sep 01, 2022 05:24 PM
Would you be able to share how you did this with a little more detail built into the steps 1-3 you laid out please? I’m having a little of a hard time following and would love to use your method!
Thanks :slightly_smiling_face:
Feb 25, 2023 01:24 PM
Some additional details on this, that I have learned from my own struggles.
The above solution doesn't work in all circumstances (depending on uniqueness of records and the type of the relationship (many to many vs one to many).
If you lay out a 3 by 3 matrix of uniqueness and relationship type...
There are 3 ways to link things up:
Some of these solutions only work from a certain direction (aka from the many side of one to many, or from the side that has duplicates if one of the tables is unique in its primary field.
Here is the table:
The reason you can't use ID in all circumstances is because airtable automations do not have a way to iterate through multiple commands for the same record entering the automation (which is needed for many to many link). You can do this with integromat, but that is more complex.
Also, constraining synced fields backed to linked fields seems to have some interesting consequences.
They really just need to enable linked fields being synced (if you are syncing both sides of the relationship).
I have been looking for help on one of those circumstance here: Recreate synced many-to-many table links based on csv text field of original record ids.