Definitely possible to make the code a little more dynamic! From your description, it sounds like you could be doing one of a couple different things: populating some other component with data from the selectedRow or using the value in a query. I’ll run through how you’d make each of those more dynamic for each.
Populating a Different Component
Easiest way here is going to be using the “Select Row” event on the tables you want to update the data in your other component. Some components, like forms, allow you to set the data directly, so your event would look like:
Other components, like tables and key_value, don’t expose the setData method in the GUI. You can still adjust the data by using a variable as their source and setting that. For example, I have a variable called key_value_data which is populating a key_value component and I can update the variable value to change the key_value components data source. If you are using data sources that have columns you may not want to show, you can use _.pick() to limit the number of columns you’re showing. This can be super helpful if your different tables have some columns in common but some that differ.
The easiest way to accomplish this is using the additional scope and passing in the value you need that way. If you’re just using dealer, then it makes sense to pass just that, but there is nothing stopping you from passing in the whole row. Again, you’d want to use a “Selected Row” event on your table to trigger this query.