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.
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.