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 / Hierarchical data disp...
Power Apps
Answered

Hierarchical data display in Powerapps.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have a requirement to display data in hierarchical manner.Something like below.

Group 1 

       SubGroup1

       SubGroup2

Group 2 

       SubGroup1

Whats the best way to implement this in PowerApps as there is no treeview control.Thanks.

Categories:
  • Mike8 Profile Picture
    1,330 on at

    Hello RoopaPendyala,

    For your example you can use two Galleries. The first gallery will display the groups kai according on which group you select in the first gallery the second gallery will display the corresponding subgroups.
    I don't know if it is the best way but it works for me.. 🙂

  • RoopaPendyala Profile Picture
    Microsoft Employee on at

    Hi Mike,

     

    can you paste sample code here ? Thanks.

  • Mike8 Profile Picture
    1,330 on at

    Hello,

    Button1.OnSelect = ClearCollect(GroupCollection,{ID:1,text:"Group1"},{ID:2,text:"Group2"});
    ClearCollect(SubgroupCollection,{ID:1,text:"Subgroup1",ParentID:1},{ID:2,text:"Subgroup2",ParentID:1},{ID:3,text:"Subgroup1",ParentID:2})

    Gallery1.Items = GroupCollection
    Gallery2.Items = Filter(SubgroupCollection,ParentID=Gallery1.Selected.ID)

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @RoopaPendyala,

     

    Could you please share a bit more about your data source? Is it a SP list?

     

    I created a SP list on my side, the data structure of it as below:8.JPG

    Note: The GroupName column and Parent Group column are both Single line of text type column in my SP list. The Parent Group column determine if a Group hierarchical has a parent group.

     

    I have made a test on my side, please take a try with the following workaround:9.JPG

     

    10.JPG

     

     

    Set the Items property of the Gallery1 (Parent Gallery) to following formula:

    Filter('20180830_case7',Parent_x0020_Group=Blank())

    Within the Gallery1, add a Label control, set Text property of it to following formula:

    ThisItem.GroupName

     

    Within the Gallery1, add another Gallery control (Gallery2, Child Gallery), set the Items property of the Gallery2 control to following formula:

    Filter('20180830_case7',Parent_x0020_Group=ThisItem.GroupName)

    Within Gallery2 control, add a Label control, set Text property of it to following formula:

    ThisItem.GroupName

    Note: The '20180830_case7' represents the SP list data source within my app.

     

    The GIF screenshot as below:Test1.gif

     

     

     

     

    Best regards,

    Kris

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 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard