Making a reference schema for a table external to the pack

Sync tables can reference another sync table within the same pack by using reference schemas. Is there a way to enable the same functionality for tables not in the pack, i.e. arbitrary user tables?

This seems to be automatically handled by coda when the display value for a row in a sync table is a link to a row in another table in the same doc. Is there any way to control this in the pack code?

1 Like

Hi @loucadufault - Unfortunately that isn’t possible today. Currently reference schemas can only reference sync tables, not regular user tables. Users can manually add lookup column to their sync tables, but it can’t be done in code.

Thanks for confirming. Is it the case that first-party packs such as the cross-doc pack do utilize such a functionality, e.g. in properly rendering chips for rows in cross-doc tables regardless of their provenance? Or does it actually just cleverly make use of other accessible functionality to achieve this?

Cross-doc lookup chips only resolve to other cross-doc tables.


The contrary — cross-doc lookup chips will only resolve if:

  • you sync not a view, but a base table where that reference is pointing

  • it’s synced from the same doc as your first table with that lookup column — i.e. you can’t sync DB Classes (referencing an import of DB Teachers) from the doc Classes and DB Teachers from its source doc Teachers — both syncs have to come from from the doc Classes.

TL;DR: in regular Cross-doc, not only it uses the same reference schema thing, but the reference schema is strongly tied to the table’s href.

It’s in my Sync Tables Pro pack where I’m jumping through hoops to work this around

P.S. Also the reason why you can’t reference tables in external packs is because all identifiers (identityName, dynamicUrl, rowId) get normalized into SHA256 identifiers along with the Pack ID — so even if you replicate the same three values above, normalized UIDs will read grid-dynamic-sync-12345-xxxxx.... and grid-dynamic-sync-67890-xxxxx.... (where those 12345 and 67890 are pack IDs), hence these won’t match and references won’t resolve.

1 Like