grist-core
grist-core copied to clipboard
Enhancement: many-to-many relationship
(first of all, thank you very much for your work)
I suggest an improvement on how a many-to-many relationship is shown in the Grist UI.
In the following example: https://docs.getgrist.com/qn81cefETPAc/Library you have a book-author many-to-many relationship: a book can be written by several authors, an author has written several books.
In the Books page you can add or remove authors.
In the Authors page you can only see related books. The books list is created with a formula.
It would be great if the books could be added and remove also in the Authors page, as in the Book page.
The m-to-m relationship would become fully symmetric.
Thank you again, Emanuele
Should such a functionality be added, I’d suggest basing it on a join table, like in this sample, instead of a denormalized reference field. That would make it easier to use, for example, with the /sql endpoint.
A neat solution for this would be to add support for SQLite Triggers in grist. Relationship tables could be automatically updated by triggers when a reference field is changed. This could also pave the way for more complex automations with grist.