May 26, 2022 12:19 PM
For a table with organizations I have a partner field that links back to the primary column itself. Suppose an organization has 10 partners and I put them in the Partner field, then all those organizations will get that one organization in their linked partner field. But I would like for them to get all the organizations in their partner field, ideally minus themselves. Thoughts on how to do that?
Solved! Go to Solution.
May 27, 2022 05:13 PM
Welcome to the Airtable community! (Do you have two accounts?)
When talking about linked relationships, we often use family terms like “parent” records, “child” records, and “sibling” records.
It sounds like you are using same-table links, which does not give you an automatic back-link field. It also sounds like you do not have a “parent-child” structure in your base. Instead all of your records are peers of each other or siblings.
It is hard to tell without more specific details, but I suspect that creating a parent record to contain the sibling group would make things easier. Linking a new record to the parent would automatically make it a sibling to all of the other records in the group, and you could use lookups/rollups to see all the siblings. In the parent record, rollup the list of all the children. Then in the child table, rolldown the list of children/siblings and use a formula to remove oneself. No scripting required.
On the other hand, if you do not want to have a parent table, you will need a script to maintain the linked records. You will also have to think carefully about how you will run the script and determine which values are the correct changes to propagate to other records.
May 26, 2022 12:27 PM
I think you’re talking about backlinks in the same table, but I’m not 100% sure.
If so, that is not a feature that is currently built into Airtable, but you can manually run this script created by @openside to do that for you:
https://builtonair.com/script/same-table-linked-records-backlinks/
May 26, 2022 12:38 PM
Thanks. I can do backlinks in the same table using a different script, and using two fields (‘partner - source’ and ‘partner - target’) and a third field that combines them and gets the unique values. The problem here is that this only results in the one organization being added to all the other organizations whereas I would like all the partner organizations added to all the partner organizations’ fields (ideally, minus itself).
May 26, 2022 08:50 PM
Hi KoenS, unfortunately you’re going to have to use a script for that I’m afraid.
This is my current understanding of what we’re trying to do
Is that right?
Some additional questions:
Once I know more I can throw something together for you that you could customize yourself
May 27, 2022 03:42 PM
Thanks for your response.
Most generally: When I have a new network of eg 10 partners, and I put all 9 partner orgs of 1 of those orgs in that org’s Partners field, I want it to, for each of those 9 orgs, also fill their Partners field with all the other 9 orgs (the 10 orgs minus itself) rather than with just that one org in whose Partner field I put the 9 other orgs.
This is a situation I will encounter regularly. So it would save quite a lot of work if I don’t have to do this manually.
May 27, 2022 05:13 PM
Welcome to the Airtable community! (Do you have two accounts?)
When talking about linked relationships, we often use family terms like “parent” records, “child” records, and “sibling” records.
It sounds like you are using same-table links, which does not give you an automatic back-link field. It also sounds like you do not have a “parent-child” structure in your base. Instead all of your records are peers of each other or siblings.
It is hard to tell without more specific details, but I suspect that creating a parent record to contain the sibling group would make things easier. Linking a new record to the parent would automatically make it a sibling to all of the other records in the group, and you could use lookups/rollups to see all the siblings. In the parent record, rollup the list of all the children. Then in the child table, rolldown the list of children/siblings and use a formula to remove oneself. No scripting required.
On the other hand, if you do not want to have a parent table, you will need a script to maintain the linked records. You will also have to think carefully about how you will run the script and determine which values are the correct changes to propagate to other records.
May 27, 2022 06:43 PM
Oh, I guess I do have two accounts. Sorry about that.
I understand and use parent-child relationships but because the partner relationship is different in structure I didn’t know what to do about that. But yours is a great solution: I can just create a dummie parent for the partners and then use the sibling relationships for their partner relationships. Thanks!