web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Building a Heirarchica...
Power Apps
Unanswered

Building a Heirarchical Report

(0) ShareShare
ReportReport
Posted on by

I am creating a report that uses heirarchical data

ClearCollect(
TableOfLife,
{Domain: "Archaea", Kingdom: "Archaebacteria", Phylum: "Euryarchaeota", Class: "Methanobacteria", Example: "Tepidaquacellales"},
{Domain: "Bacteria", Kingdom: "Eubacteria", Phylum: "Spirochetes", Class: "Spirochaetaceae", Example: "Borrelia"},
{Domain: "Eukarya", Kingdom: "Animalia", Phylum: "Chordata", Class: "Mammal", Example: "Dog"},
{Domain: "Eukarya", Kingdom: "Animalia", Phylum: "Chordata", Class: "Mammal", Example: "Cat"},
{Domain: "Eukarya", Kingdom: "Animalia", Phylum: "Chordata", Class: "Cephalochordate", Example: "Branchiostoma lanceolatum"}
);

 

I need to turn this into a report that looks like this:

<h1>Archaea
<h2>Archaebacteria
<h3>Euryarchaeota
<h4>Methanobacteria
Tepidaquacellales
Others
<h1>Bacteria
<h2>Eubacteria
<h3>Spirochetes
<h4>Spirochaetaceae
Borrelia
Others
<h1>Eukarya
<h2>Animalia
<h3>Chordata
<h4>Mammal
Dog
Cat
Others
<h4>Cephalochordate
Branchiostoma lanceolatum
Others

 

 

I started off with a nested GroupBy, but now I am stuck

ClearCollect(c2, GroupBy(GroupBy(GroupBy(GroupBy(TableOfLife, "Domain", "Kingdom", "Phylum", "Class", "ClassData"), "Domain", "Kingdom", "Phylum", "PhylumData"), "Domain", "Kingdom", "KingdomData"), "Domain", "DomainData"));

I can see that c2 does indeed hold the heirachy. You can drill down though each level and see everything.

 

I feel like I need to run a ForAll(something) on the data tables that come out of the GroupBy functions, and then use Concat() or Cancatenate(), but I can't figure that out.

 

By the way, this questions isn't about the html-like "<h1>" tags. I just threw them in so you could see the levels, although, it wouldn't hurt if they were there. This question is bout how to take the collection and turn it into a hierarchical report. The text report could be assigned to a context variable, and then I can figure out where to go from there.

 

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard