Archiving Large Docs
Over time, your docs will get too big and slow. Often times, large docs have 1-2 tables with most of the information in them. E.g.
Project management docs have tons of issues
Task management docs have lots of todos
Payroll docs have lots of line item entries
A CRM has lots of customers
Sometimes, you’ll want to take the rows in your
and archive them to another doc, then delete them from the
. This doc helps you do that.
For the settings and the formulas on the other side, see the
Create a column in
that keeps track of whether the
Find the row in this table that matches the one with the same Row Id in the archive table
Then find the ones that are identical to the current row (should only be one, because archiving is using
If the list contains anything then the current row has been safely saved
[Archive Source Table].Filter(CurrentValue.[Row Id] = thisRow.[Row Id]
AND thisRow.Row._Merge().ToText() = CurrentValue.[Row Contents]
Create the button that archives the rows. I added this to the page
Select all the rows in the table that have not been archived
Get the first 400 of them, we can’t do more than that because Coda automations can only handle 400 rows
Archive each row. Either that will mean adding a new row if the Row Id isn’t already in the table, or it will mean updating the row if it’s not archived. The Archived? column checks that the saved row is
to its match in the Archive table. If it’s not identical, the Row Contents will be updated.
[Archive Source Table].AddOrModifyRows(
CurrentValue.[Row Id] = ImportRow.[Row Id],
[Row Contents], ImportRow.Row._Merge().ToText()
Press the Archive button with an automation. You can choose whatever frequency for the updates you like.
If I’m updating a big doc, I’ll normally start by pressing the button every hour (so that I can catch up with all the data in the source doc) but then I’ll switch it to a weekly frequency once I’ve caught up (it’s rare I add more than 400 new rows to any doc per week).
Make sure that the sync frequency on your tables
and the Archive Source Table in your
is faster (more frequent) than the rate at which your automation presses the archive button
. Nothing will break, but your archive button will just be archiving data you’ve already archived, so won’t be doing much.
Export the Archived Rows
, export only the rows that exist in the source doc (they haven’t been deleted) and have already been archived.
[DB Payroll Line Items Import].[Row Id].Contains(thisRow.[Row Id])