I'm a novice at Retool and my expertise isn't primarily in development. I'd value any insights or advice.
I have four distinct tables (i.e., table_orders1, table_orders2, and so on) in Retool, all drawing data from our internal "orders" database. Each table's data is segregated based on a role field, facilitated by individual dropdowns.
The challenge I'm facing involves modals: Each table has its own button which triggers a modal window. When activated, I aim to populate default options in the modal fields, specifically to fetch the email list associated with the "clicked" table. Although I've created four separate modals, each tailored to its respective table, this setup seems unsustainable. Making alterations to the modal content would necessitate replicating the changes across all four, which is far from ideal.
Is there a more efficient way to achieve this dynamic behavior without manually configuring each modal? I've created a video for a more detailed walkthrough of my current structure:
I'm solved this by making use of a a global variable "currentTable" that stores a copy of "which table was clicked" by running a script that "sets variable" and opens the modal after, from each button "event handler"... but I'm pretty unsure this to be the best route and would really like to learn best practices
Thank you in advance for your tips!