Hello! I'm new to using Retool, and I'm trying to build a table that is similar to a demo data table (see screenshots below), but instead lists authors and the stories they have written.
Each row of the table will be a writer, and the second column of the table will be a list of stories that writer has written. Authors-to-stories is a many-to-many relationship, since each author may have written many stories, and each story may have many authors. (Screenshots of schema below)
How do I display a many-to-many relationship using a Retool Database in a Retool web app's table component as a list of format: Tags?
If I was solving this problem outside of Retool, I would likely query a SQL database from a web server once to get a list of all user IDs, names, and emails, then for each row in the table, query the SQL table with something like select title from stories where id in (select id from writers where user_id = {{row.userID}})
, but I'm not sure how to do this for loop of SQL queries in Retool, or how to look up this information in the Retool docs.
Retool Web App:
Retool Database, users table:
Retool Database, stories table:
Retool Database, writers table (using foreign keys to map many-to-many relationship):
Thanks in advance!