Expandable Tables - PostGreSQL

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