Expandable Tables - PostGreSQL

I'm trying to use an expandable table to show two child tables from two different SQL queries based on the data fields of the referenced row in the parent table.

I'm trying to figure out how to reference a specific field in the parent table to use in a where clause for my child tables.

Please help.

Assuming you're triggering these with an action in the sub-tables, I'd pass the parent row index to the query through additionalScope. A guide on how to do that is here: How to use additional scope (additionalScope) in your queries

In your query trigger, you can access the index of the parent tables through the ri variable, which is an array of indexes. If you're in the 3rd level table and you want to reference the index of the row for the top level row, you'd use ri[0], first child is ri[1] and so on. So to reference the top level row index in a child component's handler, you'd use:

query.trigger({
additionalScope: {
   rowIndex: ri[0]
}
})

Then in your query you can access the table data using table.data[rowIndex].attributeName