Check the Data action in the Demo screen and its comments on how to transform flat list results to nested list structures.