Using ListView and Grouping

I can see that tables now support grouping, but it's a shame this feature hasn't been rolled out to things like ListViews.

I have a query, and I want to group the results by a certain field from the retool database. Using _.groupBy or .groupBy creates a dictionary and makes the ListView not group correctly. Is there another way around this? This is currently my transformer:

function transformData(data) {
return _.groupBy(formatDataAsArray(data), "wbs_element");
}
return transformData(data);

But this generates a weird structure, and the listview still shows the each line from the database, instead of 1 line for example, that I can then have another listview within this listview to get the ones within it.

Hi @FloodMatt It seems like that data structure is usable if you get creative with the listviews' data sources :crossed_fingers:

Parent list view will only have the keys (i.e. the distinct values for "wbs_element"):

Nested listview will have all values, filtered by the parent item:

1 Like

Many thanks!