Filtering sub-table based on results from Expanded table

Continuing the discussion from How to use run a query on an expanded row:

I have a table, and have enabled Expandable rows. I then want to put another table in the expandable row component section. I want the source of this sub table to be from another query, and apply a filter on two columns so that the sub-table shows rows relevant to the CurrentRow in the original table.

I tried to use the same strategy as Tess did in the previous discussion I linked - "passing in all of my nested data to the table in the expandable rows and then filtering inside the component set up". In theory my code should be working, but instead I get an error saying .filter is not a function.

I don't have a JS background, so not sure where to go next with this one. Difference between Jess' example and mine is her "childQuery" is a JS query, and mine is a postgres resource query. Unsure if that makes a difference...

Using formatDataAsArray() solved the problem.

Screenshot 2024-01-23 at 4.30.32 PM

1 Like