Any suggestions on how to interact with linked tables to display them in data grids. For example if I have a customer table and that table contains a link to a transactions table, linking multiple transaction records to one customer record. How can I display a single column of the transaction records (eg: A Transaction ID) linked to that customer in a data grid column?
Hello,
If you want to show all transactions for all customers you could do a few things:
-
For each customer, you could “string join” your transaction ids together by writing some code on the server. Return your processed list of dictionaries (rows) to the client and set your data binding accordingly. It might look something like this:
[{'customer_name': 'jim', 'transaction_ids': '001, 002'}, {'customer_name': 'john', 'transaction_ids': '001, 002, 003'}]
-
You could nest one repeating panel in another allowing you to display the repeating customers as well as the repeating transactions (see the data grid tutorial for an example of crazy cool nesting)
-
You could have the UI choose one customer at a time and therefore you would just set your data bindings to that customer’s transaction IDs. Here’s an example of that:
clone:
Anvil | Login
Much depends on your app’s structure and specific needs. Please feel free to clarify further with code and a small example app if this suggestion doesn’t help.
Thank you so much for the advice, got me where i needed to be.
much appreciated