I have created self-referential one-to-many (1:N) relationship for CDM Task table, in the relationship definition the Hierarchical option is set to Yes.
In the documentation the process to query data as a hierarchy is explained for Model Driven App, I am wondering how can I show the same hierarchy in Canvas App?
NOTE: I want to go N levels deep and show all records under a selected record.
Hi @Usmannb ,
Please try the below link.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
My Blog: Dynamics 365 Key Topics – https://d365topicsbydk.com/
My Youtube Channel : https://www.youtube.com/channel/UCxSIryP2ah2VpEFr-Z72t1A
Hope you are doing good.
For 1:N Relationship and if you want to User Hierarchy, we can use Gallery Within Gallery so for a Parent Record it will Auto Show the Child Record.
1. Create a Parent Gallery (Name it as ParentGallery)--> On Click of Parent Gallery Navigate to Another Form
2. Load Child Parent(Name it as ChildLevel1Gallery) Gallery (ParentGallery.selected)
a. Here in side a Gallery Create a Child Gallery (Gallery Inside Gallery)
b. Set the Child Gallery (Name it as ChildLevel2Gallery) and Filter it as (ChildLevel1Gallery.Selected)
Thats it 🙂
You can find a Reference link here too : https://powerusers.microsoft.com/t5/Building-Power-Apps/Hierarchical-data-display-in-Powerapps/td-p/...
Please mark as Answer if it is helpful and provide Kudos
Please see my blog post below that demos how to easily descend through multiple tables to view descendants using the ForAll function
Thanks for your help but I am not looking to relate the records but to actually query the related records in hierarchy.
Very well written blog but my Database structure is different then yours. I am looking for a solution to query "Hierarchical" Dataverse relationship.
The principle is the same whether it is seperate tables or self-joins in a single table hierarchy
To present the results exactly as you require is challenging. Embedded flexible height galleries would be an ideal approach as you could click and expand to show the hierarchy structure, but unfortunately they can only go down 2 levels
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!