How to add a parent field to child field

In a detail view, I have a ‘parent’ table called EPICS and a ‘child’ table called STAGES.

Using a ‘detail view’ on the EPICS table showing the STAGES of work in an EPIC, I want the EPIC’s name automatically added to the STAGES rows as I add each stage into the STAGES table.

Currently, I type the parent EPIC manually into the STAGES table.

I’ve tried lookups and filters but I’m a bit lost, any help will be appreciated!

@Markus_Smet

I’m not clear on what you want. As a starting point, see if this doc gives you an idea you might be able to use. Play with the Filter() formula in the blue column.

1 Like

PS - I like the new chip design for hoverable row references! Unobtrusive, adaptive to conditional formats, hover transform, obvious to the eye… :+1: @nathan @mallika

3 Likes

You Sir, are a legend. That was exactly what I needed, thank you!

Here’s the solution:

  1. In the Epic field of the STAGES table (which is a Lookup on the EPICS table) create a formula with the code: epics.Filter(stages.Contains(thisRow)).
  2. Build/open a Detail View on the parent EPICS table which should lookup the STAGES table.
  3. Add a ‘new’ blank row to the STAGES table.
  4. Automagically the EPIC names appear in the STAGES table.
1 Like

@Markus_Smet

Glad that worked for you.

I updated that doc to include another variation. This represents one-to-many relationships, whereas the previous example represents many-to-many relationships. Which one to use depends on your use case.

Brilliant.

Given Coda is so great at building relational tables, understanding how to work with one-to-many and many-to-many relationships is very useful. Thanks for your time!