Do docs/tables created from template dynamically update when template changes -OR- Automation Rule to alert when new Packs are published

#1

I’d like to be alerted when new Packs are added to coda. Today I explored various ways to accomplish this goal within coda; since I’m a new user, I thought it might be helpful to the developers if I shared my assumptions & processes for doing so:

1st attempt:

  • opened Packs Starter Kit Template: https://coda.io/t/Packs-Starter-Kit_tDpsxMCm1or/preview

  • navigated to “:heart_eyes: All the Packs” section / table

  • clicked :robot: Automation icon; opened Automations rules editor

  • created rule that triggered on changes to “:heart_eyes: All the Packs” table name column, sending me alert with name

  • later on realized that probably none of my actions had been persisted since I had been interacting with the ‘preview’ mode of the template

2nd attempt:

  • clicked “Copy Doc” button in Packs-Starter-Kit template to make my own private doc copy of the template

  • created new table with intent to set column content dynamically by using “Lookup from Table” column type and referencing “:heart_eyes: All the Packs” table in source template

  • slowly realized “Lookup from Table” is confined to document-level scope :cry: (so are all non-api operations?)

3rd attempt:

  • Signed up for Google Apps Scripts & provisioned coda.io Api auth token

  • created Google Apps Script to one-way-sync the table I created earlier in my copy of the template with the “All the Packs” table in the original template;

  • realized there are no CodaAPI methods for querying public templates :cry:

  • :thinking: what about using CodaApi.listFormulas() to enumerate all formulas, filtering for ‘::’ (which may be unique to Pack-specific formulas), and updating my table based on result?

    • oh dang, listFormulas endpoint is /docs/{docId}/formulas - it’s only for getting list of formulas included in specific doc :cry: (not templates don’t be silly)

4th attempt:

conclusion:
Guess I’ll just wait for cross-doc features to be implemented (hopefully there will be some cross-template features too :slight_smile:


:shushing_face: shhh… 5th attempt

// from developer js console when logged into coda & browsing 
// https://coda.io/t/Packs-Starter-Kit_tDpsxMCm1or/preview:

await fetch('https://coda.io/internalAppApi/packs')
.then(res => res.json())
.then( ({manifest: {packs}}) => 
  packs.reduce( (acc, curr) => 
    acc.concat(curr.versions[0].name), [] 
  )
)
// resolves to ["Spotify", "Debug", "Slack", "Intercom", "GitHub", "Weather", "Gmail", "Greenhouse", "MLB", "Stocks", "Google Calendar", "Figma", "YouTube", "Instagram", "Walmart Shopping", "Wikipedia", "Twilio", "Google Natural Language", "NBA", "FullContact", "Dropbox"]

:smile:

0 Likes