Mar 12, 2019 09:59 PM
I’m using a table to keep track of types of relationships for a project and I was wondering if it was possible to add lookups to a matching cell automatically when placed in the first.
For example, if I had Sam and Jack in the first column and then, using lookup, added Jack to Sam’s enemy column, is there a way to add Sam to Jack’s enemy column automatically?
Thanks in advance for any help!
Mar 13, 2019 04:05 AM
Well, yes and no… :winking_face:
When you say ‘using lookup’ you’re skipping an intermediate step: Namely, the creation of a link between records of two (usually; see below) tables using a linked-record field. A lookup field essentially follows a link from the current record to one or more linked records and retrieves the value or values of a specified field in the linked record(s).
Typically, one uses a lookup field when trying to retrieve the value of a field other than the primary — first — field of the linked record. This is because the linked-record field itself contains the value of the linked record(s) primary field(s). That is to say, if I have a linked-record field named {Link2Color}
in my [Main]
table, and the current record of [Main]
is linked to records ‘Red
’ and ‘Blue
’ in my [Color]
table, the value of {Link2Color}
in my current table would be ‘Red, Blue
’. I could create a lookup field that followed the link specified in {Link2Color}
and retrieved the value of the linked records’ primary field — but as the result would be ‘Red, Blue
’, doing so would be a redundant step.
When I indicate a linked record from [Main]
to [Color]
by creating the link in {Link2Color}
, I automatically create a reciprocal link from [Color]
to [Main]
. (By default, that reciprocal link carries the name of the linked-from table, so in this case each record in [Color]
would have a linked-record field simply called {Main}
.) I can use this reciprocal link as I would any linked-record field; for instance, to display a list of all [Main]
records linked to the ‘Red
’ record in [Color]
.
In the case of Sam and Jack, then, you could link from ‘Sam
’'s {Link2Enemies}
field to ‘Jack
’'s record and have a reciprocal link created automatically from ‘Jack
’ to ‘Sam
’…
…except there’s a catch.
Earlier I said one usually created a linked record between records of two different tables. It is also possible — and, from your description of your base, it seems applicable to your use case — to create links between records of the same table. That is, ‘Sam
’ and ‘Jack
’ would both be records of, say, your [People]
table, and ‘Sam
’'s {Enemies}
linked record field would link to ‘Jack
’'s record in the same table. In such a case, Airtable does not create a reciprocal link. ‘Jack
’'s record would contain an {Enemies}
field, and it could be linked back to ‘Sam
’, but the link would have to be created manually: It won’t be created automatically.
Why this is the case, I’m not sure — you can convince me either decision (to create or not to create a reciprocal link) is correct — but it is Airtable’s current behavior.
I hope that explanation wasn’t too convoluted; if I stumbled around to much let me know and I’ll give it another try…
Mar 13, 2019 10:25 AM
The non-auto reciprocal link works for situations for when 'Sam'
's linked field is indicating hierarchy, i.e. {Manager}
. Obviously, 'Sam'
should not automatically be added as 'Sam'
's manager’s manager. But anytime the linked relationship isn’t hierarchical this logic doesn’t fit. A toggle in the Customize Field Options dropdown would be nice to turn on/off this behavior.