Create new rows in relation columns automatically

Hi everyone,

I am trying to find a smart way to create new rows in a related table when data is essentially “pasted” into a row.

I have a table that has several relation columns with other tables. Obviously, if I was manually adding the data in Coda it would be easy to work with these relation columns - you just type what you need in and when you hit enter on that it will create a requisite row.

But if you paste data into a row (or use something like Make to copy data into a Coda table, like I’m doing in this case) Coda will not go ahead and create a requisite row in the related tables automatically. Instead you just see the text without a “bubble” around it, meaning its not actually relating to a row in that table.
image

What is the best way to automatically create the required relation row whenever it is required?

I think this might be a fairly common quirk of Coda that sometimes needs to be worked around, so if you have some thoughts on how this should be handled please let me know. But read more below if you want to know how my solution to handle this has gone so far.

Context: I have a table called Task ID, and a table called Time Logs. The time logs table includes a unique Task ID that associates the log with a particular task. When a time log is created I need to automatically create a row in my Task ID table that relates my time log to that ID if it doesn’t already exist.

So far I have added buttons that create the required row in the relation table, then runs an additional action after that ensures the time log is actually associated with that newly created row:

runactions(
AddOrModifyRows(
[Task Id Table], “”, [Task Id Table].[Task Id], thisRow.[Task Id]
),
ModifyRows(thisRow, thisRow.[Task Id], thisRow.[Task Id])
)

This works just fine, but I don’t want to manually press these buttons I’ve set up. I want this to automatically happen when each row comes in that has a new Task ID not currently included in my task ID table.

So I set up conditions to disable the button when the task ID already exists in the Task ID table to prevent duplicates:

[Task Id Table].Contains(thisRow.[Task Id]) OR thisRow.[Task Id].IsBlank()

Then I set up an automation to click the buttons each week. I was happy to see that the automation appeared to respect the disabled state of the buttons and skipped pressing the button when appropriate.

However, this doesn’t work very well when you are working on a large batch of added rows at once. My automation is set to run when a row is changed in my Time Logs table. When dozens of rows are added to the table at once, the automation doesn’t seem to really work in a particularly clean sequencing of events. Everything sort of seems to be happening at once and it doesn’t respect the fact that the buttons are disabled when a task ID may already exist. So buttons that should be disabled by the time the automation reaches them are not. if I have two time logs relating to the same task ID, I may end up with 2 rows added to my Task ID table instead of one.

I’m looking at possibly rate-limiting my adding of the rows via Make so that it doesn’t flood the system, but that’s not ideal.

Anyone have experience in this and is willing to help?

Thanks.

Okay, just realizing that my hackneyed solution isn’t working because my button is bundling two actions into one when in reality sometimes its needed for only one of those actions to take place.

Also realizing several other problems with my approach… Probably kind of need to go back to the drawing board on it. So I’m just gonna say right off, maybe instead of trying to fix my method (which would be complicated) I’m more interested in hearing someone else’s’ approach to addressing this problem as a whole.

Hi Mitchell,

Not sure what you mean with the above.

I do not have enough information to understand your problem fully. The simplest solution would be to make sure that the task id exists, before you refer to that task id in your log table.

What is preventing you from doing that?

P

Hi @Piet_Strydom

I’m referring to Make.com which is a service similar to Zapier. The data is coming from a source external to Coda (Teamwork, our project management app) and unfortunately there are no packs available that would make syncing this data between my services simpler for me.

I need to replicate the hierarchy of our project management app in Coda in order to find insights in the data. The time logs that I’m syncing here to Coda from our project management app is the smallest piece of data that we need from it. Each time log comes with enough data about what projects and tasks it belongs to that it allows me to really paint the whole picture of what’s going on in our project management app within Coda without requiring a bunch of other distinct integrations.

I could set up multiple integrations between Make and the data source so that Make creates the Task IDs as well, but that makes the order of operations on that side more complicated and increases the load on Make (which may end up meaning I’d be charged more for their service). I would much prefer to just throw all the data at Coda through a single stream and allow Coda to sort it out.

The simplest alternative might be too get rid of the task ID table, and make the task ID a select list