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?
Example:
Task 1
Task 2
Task 5
Task 6
Task 7
Task 10
Task 11
Task3
Task 4
Task 8
Task9
....
NOTE: I want to go N levels deep and show all records under a selected record.
Hi @Usmannb ,
Please try the below link.
Relate records in Many-to-Many relationships | Microsoft Power Apps
-------------------------------------------------------------------------
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
Regards
Devi
Hello @Usmannb,
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
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
Hi @Usmannb
Please see my blog post below that demos how to easily descend through multiple tables to view descendants using the ForAll function
Chris
Hello @DeviKrishna
Thanks for your help but I am not looking to relate the records but to actually query the related records in hierarchy.
Hello @rampprakash
Thanks for the solution but it is not suitable to show N-levels of related records.
Hi @ChrisHarper
Very well written blog but my Database structure is different then yours. I am looking for a solution to query "Hierarchical" Dataverse relationship.
Hi @Usmannb
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
User | Count |
---|---|
19 | |
9 | |
8 | |
5 | |
5 |
User | Count |
---|---|
32 | |
29 | |
18 | |
18 | |
6 |