I’m currently working with a table component in Retool that uses a drill-down feature to group rows. The issue I’m encountering is that when I export the data from the table, I get all of the rows instead of just the grouped rows, which defeats the purpose of the grouping feature.
What I would like to achieve is to export only the grouped rows without the individual, drilled-down data.
Here’s a screenshot of the table component in Retool, showing the grouped rows:
The workaround I'm working on consists on event handlers for 'Expand row' and 'Collapse row' to keep track of which rows are expanded. Then, use JS to filter the results from table.data, in order to only return the results from expanded rows.
However, I just found out that those event handlers are not for grouped rows but for 'Expandable rows.' For example:
I have an event handler to log whenever the rows are expanded or collapsed but I don't get anything on the console.
I’ve created an internal report for this issue, as it has the potential to cause confusion. In addition, I created a FR to be able to include current grouped rows settings on the data that gets exported. We'll update you here when there is movement on these requests.
On the meantime, we could use a Multiselect component to have users select 'X', 'Y', and/or 'Z', and filter the data source of the table accordingly. This way, the table will only render rows that match the selection, and the exported data will only have these rows. I know this workaround is not ideal but it would make it so we can keep the grouped rows and only export relevant data. The tradeoff is that the exported data wouldn't include groups that are not selected.
Hi Paulo, thanks so much for looking into this! Having the option to exclude hidden rows in data exports would be really helpful. I’d like to stay updated on the FR, please keep me posted!