Bidirectional linked relation to/from same table (but as a single column)?

I’m looking to add a “Related” relation column to a table, such that two rows can link to each other as being equally related (i.e., there is no difference in meaning to the relation depending on the direction).

I can select the same table easily enough, but then I have the choice of making it either a linked relation or not-a-linked relation. Neither is perfectly ideal, because:

  • As a linked relation, I end up with two new columns on the table to signify the relationship (which is meaningless here).

    • This would make sense if it were a parent–child relationship, or where the “direction” of the link matters.
    • In my case, though, it doesn’t—if A and B are related, then B and A are equally related.
  • As a not-linked relation, I get one column (which is good), but if I update A to “relate” to B, this is not reflected in B.

What I’m looking for, in summary, is:

  • A single column on my table that links to one or more other rows in the table
  • When I add a link in one row to another row, that other row also links back in that same column
  • When I remove a link in one row to another row, that other row also stops linking back in that same column.

Is this possible without, say, automations (which would chew up my automation quota pretty much instantly)?

1 Like

Hey @LxAU,

Thanks for writing in. We would be happy to look at this for you. Are you able to share a sample doc or something your working on? I want to make sure we are understanding your correctly. Thanks for any help or post you can share.

Best,
Dan

1 Like

Thanks @Dan_Demers. Hopefully this captures what you’re looking for:

2 Likes

Hi @LxAU ! Thanks for following up with that information. After reviewing this, our team has deemed this a feature request. That said, we have moved this post into the Suggestion Box for other members of the Community to chime in on this. We’ve gone ahead and tracked your vote for the ability to have bidirectional linked relation to a same table using a single column.

4 Likes

I came here searching for an answer to this exact same thing.

Relations like this are called symmetric relations and they’re pretty common, for example “sibling of” is a symmetric relation. If x is a sibling of y, then automatically y is a sibling of x. In a task tracker, “duplicate of” and “related to” are examples.

I don’t know of any of the popular no-code / low-code apps that can handle relations like this properly. It would be really cool if Coda introduced this.

The examples I mentioned are also transitive (but not all symmetric relations are). So if x is a duplicate of y, and y is a duplicate of z, then x is a duplicate of z. So if you were to introduce this relation type, you might want to include an option for transitivity.

3 Likes

Thanks Darren!

Notion does symmetric relations well if anyone here needs some “inspiration”.

A transitivity option would be nice bonus—but a basic symmetric relation would at least allow this to be “faked” with one additional calculated column.

2 Likes

Ah yes, so it does! It’s a very nice, simple UI too:

Notion’s lack of filters on relations makes it unsuitable for many of the things I want to do so I haven’t really used it much.

Hey @LxAU , did you ever come up with a solution?

I’m looking to build the same thing (demonstrating Contacts connections to one another).

  1. I too have found automations as a possible but non-ideal solution.

  2. Another way would be to create a separate table where each row is the “Link” between two Contacts and I can filter how to show it. I think I’m pursuing this build as of right now as an indirect solution.

  3. I’ve not completely worked through it but I have a feeling that there exists in a solution where you could hide one of the two necessary columns for the Connection. I’m not sure this would be completely functional without automations either.

Interested if you’ve come up with anything new!

I haven’t pursued this any further. I guess I’m just holding out for a symmetric relation feature from the Coda team in due course.

I’m interested in learning more about your possible “separate table” solution though!

Here’s my workaround:

Step 1: In your table, create a column that relates back to the same table (Column 1).

Step 2: In the column options for Column 1, click the ‘Create column’ button under Create linked relation. This will generate a second column (I’ll name the Column 2).

Step 3 (optional): Go into the column options for Column 2 and turn of Allow Edits. (not necessary, but it simplifies using this process if you can only have one column thats editable)

Step 4: Now create another column that links to the same table (I’ll name this Related Rows). This will be a calculated column that combines Column 1 and Column 2. Go into the Calculate section for this column and put in the formula

SwitchIf(
[Column 1].IsNotBlank() AND [Column 2].IsBlank() , [Column 1],
[Column 1].IsBlank() AND [Column 2].IsNotBlank(), [Column 2],
[Column 1].IsNotBlank() AND [Column 2].IsNotBlank(), ListCombine([Column 1], [Column 2]).Unique())

Note: Initially I tried just using the ListCombine formula on its own but the results would show Blank as one of the items on the list is either Column 1 or Column 2 were blank. So this was the only other way I could think to write it.

Now you should have:
(1) an editable column in Column 1 where you can link rows
(2) Column 2 can be hidden as you won’t be doing anything else to this one
(3) a third row that lists everything that this row relates or is related to.

Once Coda rolls out this feature, I figure you can delete the second and third columns and have the first column as the bidirectional relation. :slight_smile:

Hope this helps. Below is a link to a sample table I made using this process.