Archive Doc
Share
Explore

icon picker
Archive Doc

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.
Watch this video:
Loading…
For the settings and the formulas on the other side, see the .

Archived?

Create a column in that keeps track of whether the
Check if the content that we archived (which we cached in the column Archived Content) is the same as the current row’s content

thisRow.[Archived Content] = thisRow.Row._Merge().ToText()

Archive Button

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
Cache the row content so that we can detect changes to the data
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 identical to its match in the Archive table. If it’s not identical, the Row Contents will be updated.

[Source Table].Filter([Archived?].Not()).Slice(1, 400).FormulaMap(WithName(CurrentValue, ImportRow,
RunActions(
ImportRow.ModifyRows([Archived Content], Row._Merge().ToText()),
[Archive Source Table].AddOrModifyRows(
CurrentValue.[Row Id] = ImportRow.[Row Id],
[Row Contents], ImportRow.Row._Merge().ToText()
)
)))

Automation

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 (both the 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.

image.png

Export the Archived Rows

In , 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])

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.