Automatically reference parent row in a lookup field

Hello! First time caller on the forum here :slight_smile:
If my question is answered elsewhere (if feels like a common issue), i’m happy to get a link. Could’t find it myself.

TL;DR: How can I get a lookup field to automatically reference its parent row, but also keep it open to manually edit.

Let’s say I have two tables: Notes and projects. And I have a lookup field so I can connect notes to a certain project.

If I open the canvas view of a project I want these notes to show up here. But also (and this is my issue) when I add a notes in this view, it should get the project label of it’s parent project automatically.

  • The first way I tried was actually putting a table view of the notes database on the actual canvas, and filter it to only show notes with the label of its parent project. This actually works pretty good… When adding a new note on the canvas it automatically gets the right label.
    .
    But I don’t like that the tables are on the canvas… it makes it harder to put in a emplate. (possible with ‘base canvas field on other item’ but becomes a mess quickly). Also: It means that for every new project a new table view is created. This becomes a mess quickly, that is hard to maintain when the system grows.

  • Second option: have a lookup field in the project table that connects to the notes table. And then let this field appear as a table in the canvas view of the project. Great! But… now i’m not able to add a new note from that canvas view and give it the right project label automatically.

I really hopes this makes sense! I dabbled in formulas, but even with some javascript coding experience I can’t get it to work… :frowning:

If you made it this far. Thanks for your effort. And Thanks for you help!

Dear @Jarno_Michel, welcome to the Coda Maker Community,

With my best intention, I would recommend to have a look at the technique used by @Scott_Collier-Weir in this video: Automating a Newsletter with Coda - YouTube

I have the feeling that this is what you are looking for :thinking:

2 Likes

Thanks for the link! Very interesting…

But… I think I might have missed something when messing around with this issue earlier. Because I just recreated the situation with a lookup field shown as a table in the canvas view. And I am indeed able to add new notes, and indeed it automatically gets the right label.

Oops… Don’t know what I did wrong the last time. But it seems to work now. Sorry to bother anybody.

Very useful video nonetheless!

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.