Backlinks. Is it possible?

Hello!

Is there a method of getting the reverse output of a UserTable.lookupRecords().

i.e. a function to return the models and records to which the calling record it linked?

Would you please have a sample to illustrate what you intend to get?

unfortunately, Its a concept which I have not seen in grist, meaning that i am not in a position to build an example.

The idea is, if a record R, in table T, is referenced by X amount of tables. The ability to run a query to find all references to T.R

apologies in advance, if my explanation is lacking. I will try again if it is not clear.

I’m not sure I understand exactly what you mean. If you intend to get all references to “this record” in a table, it’s easy thanks to lookupRecords and CONTAINS. If you intend to get all references from any table, I don’t think it’s possible. Sample here to serve as a basis for discussion.

Yes, The intention is to get all references from any table.

This allows uses to create an arbitrary number of tables with their own schema. But a core table can pull on those User defined tables.

I think the only solution for that would be a custom widget.

Yes that’s a good idea.

Though is there a function which can find a list of tables in grist?

or would i need some sqlite level fiddling?

There is such a function in the Plugin API doc.

1 Like