Skip to main content

Need a two-way link to other records in the same table.

  • February 27, 2025
  • 5 replies
  • 19 views

Forum|alt.badge.img+3

Hi,

I have a database for planning a vegetable garden, within it there is a table for vegetables which contains a field called 'avoid', this links to records in the vegetables table that this plant shouldn't be planted near. I would like to do some sort of rollup / lookup to show a list of vegetables that need to avoid this plant.

Beans need to 'avoid' onions.

In the onions record I'd like to see field that says onions are 'avoided by' beans.

This is similar to a two-way link where one person becomes their daughter's mother after making the link.

Any ideas? Thanks.

5 replies

Mike_AutomaticN
Forum|alt.badge.img+21

Hey @mutleybones!

What you are describing is what is called a backlink. This is currently not supported by Airtable when linking a table to itself (which is actually a widespread need).

However, a workaround for it would be to have a script that will do the work for you living within an automation.
You can implement this specific script that was previously shared on the community.

If you need any help setting that up, I'd be happy to help out. Just grab a slot from my calendar.

Mike, Consultant @ Automatic Nation


Milan_Automable
Forum|alt.badge.img+8
  • Participating Frequently
  • 47 replies
  • February 27, 2025

Hi @mutleybones ,

Love your use-case 🙂

If this is an option for you, you can make this work by adding a separate helper table to record the Avoidance relationship; with two Link fields.

Then you can make a Lookup on the Vegetables table on the Avoided in Avoidances, and tada 🙂

And another lookup field to see which are the veggies this one is avoiding.

If you prefer not to use a helper table, this would be possible with a script triggered on the Avoid field change. But it's both more complicated to set up and - depending on your package - automation runs are limited.

Hope this helps 🙂

-- Best, Milan - Automable.AI Free Airtable consultation

 


Forum|alt.badge.img+3
  • Author
  • New Participant
  • 2 replies
  • February 27, 2025
Mike_AutomaticN wrote:

Hey @mutleybones!

What you are describing is what is called a backlink. This is currently not supported by Airtable when linking a table to itself (which is actually a widespread need).

However, a workaround for it would be to have a script that will do the work for you living within an automation.
You can implement this specific script that was previously shared on the community.

If you need any help setting that up, I'd be happy to help out. Just grab a slot from my calendar.

Mike, Consultant @ Automatic Nation


Okay, thanks, I'll give the script a whirl đź‘Ť


Forum|alt.badge.img+3
  • Author
  • New Participant
  • 2 replies
  • February 27, 2025
Milan_Automable wrote:

Hi @mutleybones ,

Love your use-case 🙂

If this is an option for you, you can make this work by adding a separate helper table to record the Avoidance relationship; with two Link fields.

Then you can make a Lookup on the Vegetables table on the Avoided in Avoidances, and tada 🙂

And another lookup field to see which are the veggies this one is avoiding.

If you prefer not to use a helper table, this would be possible with a script triggered on the Avoid field change. But it's both more complicated to set up and - depending on your package - automation runs are limited.

Hope this helps 🙂

-- Best, Milan - Automable.AI Free Airtable consultation

 


Okay, I'm going to try the script above, but I'll bear this in mind, thanks.


ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8779 replies
  • February 27, 2025

@mutleybones 

Two scripts that do this are available here and here,

For a no-code way of doing this that doesn’t require writing any scripts at all, you can create your own custom automation to create your own backlinks.

You can do this with Airtable’s automations, now that they have added the ability to “find records” in their automations.

However, I often recommend that people use Make’s advanced automations for Airtable, which gives you much more power & control than Airtable’s automations. But there is a very steep learning curve with Make (i.e. it could take days or weeks to learn), which is why I’ve assembled a bunch of Make training resources in this thread.

Hope this helps! If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld 


Reply