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 / Show a list of each re...
Power Apps
Unanswered

Show a list of each related item of all related items in a model driven app

(0) ShareShare
ReportReport
Posted on by 601

Dear,

 

I have 3 entities A, B and C with the following relationships:

[A] 1 --> many [B] many <-- 1 [C] 

 

How do I show a list of all [C] records on a form for record [A] (through [B])?

 

Thanks,

Koen

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    Back in 2011 there was approach called "Deep Queries" - https://cloudblogs.microsoft.com/dynamics365/no-audience/2012/04/16/deep-queries-for-subgrids/

    I'm not sure if it works now.

    Other than that - I don't recall any OOB options. Obviously, you can build something to implement your requirement.

  • cchannon Profile Picture
    4,702 Moderator on at

    If the above relationships are correct (1 to many A->B and many to 1 B->C) then C is an attrib of B, so you can just add C (the column) to the view of B, as well as any other attribs you like off C, then show it on A in a subgrid of B.

     

    Example:

    On an Account, I have many contacts, each contact has one Primary Address. I want to show all Primary Addresses on the Account. I create a view of Contacts that shows their primary address column and any attribs off Primary Address I need, such as City, State, Zip. Then on the Account form , I add a subgrid of contacts and select the view I just created.

  • KoJaPD Profile Picture
    601 on at

    Hi @cchannon , you are so right, I just didn't see it that way... One additional challenge however, I would like to see a distinct list 🙂 because in your example if a lot of primary addresses are the same amongst contacts I would see them as duplicates...

  • cchannon Profile Picture
    4,702 Moderator on at

    OK, well in that case there isn't a filter that will get you a distinct list, but you can still accomplish this by just manipulating the relationships as they are updated.

     

    I would create an additional N:N relationship between A and C, then create a PowerAutomate Flow that fires on update of B when column C changes. In that flow, retrieve A (easy, because it is a lookup field on B) then retrieve all C vals on B records related to A. Then update the relationship on A to point to those C vals. 


    Presto! you have a direct relationship to C now that PowerAutomate can maintain for you.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @KoenJanssensPD , 

     

    If I understand right , you need a fetch with distinct, where you select only attributed from C. Something like this (or similar, given the model):

    <fetch distinct="true" >
     <entity name="A" >
     <link-entity B... intersect="true" > 
     <link-entity C >
     <attribute name="name" />
     </link-entity>
     </link-entity>
     </entity>
    </fetch>

     Hope it helps!

    Kind regards,

    Diana

  • cchannon Profile Picture
    4,702 Moderator on at

    Does the distinct operator work like that in fetch? I must confess, I have never tried but I assumed that it would give you a distinct collection of A with attributes from C, not a distinct collection of Aâ‹…C

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @cchannon ,


    FetchXMl distinct works exactly like SQL. It applies on the attributes you select. So if you select only attributes from C, will apply to that.


    Kind regards,

    Diana

     

  • cchannon Profile Picture
    4,702 Moderator on at

    TIL

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard