Combine rows from multiple tables into a single table?

I work across multiple projects. I want to be able to have separate tables to track work for individual projects, then bring any rows with a due date of today (or check box of same) into a separate table to view them together so as to focus my daily work. I’ve been through a bunch of tutorials and haven’t figured out if this is possible.

Thanks in advance

4 Likes

@Jeremy_Kriegel

You can do this sort of thing using Views. Study the filters on the top 3 View tables in this doc. Maybe something like this can keep you moving forward.

1 Like

Thanks for the reply. I don’t think I explained myself very well.

If I have 3 separate tables, projects 1, 2, & 3, I want to pull some rows from each of those tables into a new table. Not filter rows from a massive table into separate tables. Thanks.

2 Likes

@Jeremy_Kriegel

You can probably use buttons or automations to do something like that.

NOTE: In that Views setup, you can hide the master table (for example, put it on a different section) and interact exclusively with the Views on an individual basis. You may have privacy reasons or similar that preclude such a setup.

1 Like

That’s exactly what I did. I created one massive table and then a bunch of views. I’m a bit concerned for performance as it grows, but hopefully will not be an issue.

Thanks again for your input.

1 Like

This is really stretching it, but take a look:

5 Likes

That looks great! I need to parse your code a bit as it is more complex than what I’ve done so far, but THANK YOU for setting this up!

2 Likes

@Jeremy_Kriegel I would like to understand your scenario better. Usually we recommend creating views and filtering them to show contents esp. as you are copying data between two tables - that seem to suggests both tables have identical schema.

if you really want to copy records, here is what I would recommend

  1. Create a column of type button on each of the source table that copies that specific row into destination table lets say copy to target table
  2. Create a button that clears target table
  3. Create another button that clicks clear target table and then copy to target table on each of your source table.

That way it would be easier to manage in future.

here’s a sample doc.

1 Like

Thanks for your reply @Krunal_Sheth. I didn’t want to copy data as then everything is disconnected. I think my mental model didn’t fit with how coda works. I wanted to have project level tables that I could pull out top tasks from into another table that would represent work for the day.

I ended up doing what you (and others) suggested. I have one master table with a number of filtered views, one for each project, as well as for priorities across projects.

Excellent! Thank you.

@Dalmo_Mendonca I can’t access the logic/code you used. I’d love to learn how you did this as well. I have 2 tables that sync over from outside sources and need to be able to combine them in one.

Thanks so much!

Hi Mike,

Could you expand a little bit on your requirement?

Do the tables have the same columns? If not, do they have overlapping columns?
Do you need to match rows between the two tables, or add all rows from both tables?
Will it be a once off, or will one, or both, of the tables periodically get new rows that also need to be copied?

Regards
Rambling Pete

I have multiple tables (5 tables) that I want to merge into a single table that dynamically updates when changes are made to one of the five tables. I can’t have them all in a single table – they are each project based and clients must only see their table. I want to merge certain fields that are of the same type, but not all fields in the tables.

Thanks for your help!,
Amy

Hi Amy, if I understand correctly, you want to merge your 5 tables into a single table but all fields are not a perfect 1:1 match. That’s not a problem for Coda and would simply mean that you have some columns with empty values. You can use the same approach that’s been implemented here by another Codan. Hope that helps!

If clients are only allowed to see their own data, they would each need to have their own doc, which means that you will have to use cross doc or webhooks to copy the data.

Webhooks would probably be the best in this many to one scenario.

I have a similar problem:

  • Each Project has its own doc with some standard tables (and these are the source of truth)
  • I want to be able to aggregate these standard tables into one “master table” (I don’t have a need to edit anything here, it is just an aggregator table for view-only)
  • New projects are created and old ones are archived, so there needs to be some straightforward way to manage that.

So far I have thought of 2 approaches:

Approach 1: Independent tables / cross-doc / automate consolidation.
Every time a new project is created, add each standard table in the project doc to the master doc containing the master table. Create some buttons in each row to update (or delete and create from recreate a master table from scratch) in the imported cross-doc tables that are present in the master doc. Automate pressing these buttons (e.g. every day). For projects that get archived, create a column in the original project table with check box indicating the project is archived (using a control to apply to all rows).
Challenge: having to manually add a cross table of the project doc into the master doc every time a new project is created.

Approach 2: Each project’s table is a filtered view of the master table
That would be my go-to solution if all tables were in the same doc, BUT I understand cross-doc sync is one way only (in this case, from Master doc’s table to Project doc’s view of the table)

As I am writing this post, I found a few interesting packs I will explore:
Table Duplicator
Merge Tables
Two-way Sync

Curious to know, did you find a solution? I have a similar problem to yours and the OP’s.
Multiple projects that use the same (or very similar) tables for project management. Tables are in their own docs.
I want to aggregate the tables and then filter based on Owner. So that a single resource, let’s call her Rita, can view her tasks across all projects.

Rita would be able to use this table to prioritize her work across projects by moving task rows around so they are ordered in priority (but this wouldn’t affect the placement of the task in the master table).

Hi Janwyn,

The first question is why do you have the projects in different docs?

The generally recommended approach is to have a single doc, with a single project table, and then with views as needed. If needed, new docs can then be created with Embed pages to the main doc.

Regards
Piet

Hi @Piet_Strydom

A single-doc approach makes sense when you don’t have too many of them and you don’t care who can see / access what.
I have many projects and I don’t want users to necessarily have access to everyone else’s data. I could manage that using view filters based on a view entitlements table per project, but there is also project specific pages that vary and not necessarily on a table.

@Janwyn_Toy : One approach I am thinking of is to have a single doc with a single table for all projects, generate views for each project and embed that view on the project’s doc with 2-way sync.

Hi Jean,

For the time being embed is not going to limit access to data. That will hopefully arrive during the rest of this year. At the moment cross-doc, or one of the alternative packs will give you the access control that you need.

Regards
Piet