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 all child records...
Power Apps
Answered

Show all child records in gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

In a CDS database have a parent entity and several child entities with a 1:M relationship. 

 

In the Canvas app in the homescreen I have Gallery1 and Gallery2. In case user clicks on Gallery1 variable is set to 1, in case user clicks on Gallery2 variable is set to 2. In both cases it navigates to screen2.

 

On screen2 I want to show all related records of child entity e.g. "Notes" in Gallery3. I set items of Gallery3 to this: 

If(variable=1,Gallery1.Selected.Notes,variable=2,Gallery2.Selected.Notes).

 

This does not work as expected only see empty lines (the number of empty lines is correct though). If I set items to e.g. Gallery1.Selected.Notes everything works as expected. Also if I retype "Notes" in the formula above, it will work for a while. 

 

Could you please let me know why it behaves like this? 

 

Thanks

Categories:
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @MZ2 ,

    YOu can Set the Arrow Button /On Select Properties Like below

    Set(AllChildItem, Filter(ChildTable,IDColumn=ThisItem.ID))

    And.

    Set the AllChildItem variable to gallery3 Item properties..
    .
    Thanks,

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @VijayTailor ,

    thanks, good idea. Do you have any idea why my formula won't work? It must be something related to accessing the child records, as it works in other cases. I have several galleries on screen2 where I want to show child records from different entities and my approach would not require defining lots of variables.

  • Vijay Tailor Profile Picture
    2,961 on at
    Sure, I can help you can you please mention your code here. so I can look into that and resolve if any issue.
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @MZ2 ,

    Do you want to display all related items of child entity in gallery3?

    Could you tell me:

    1)formula in gallery1's Items, formula in gallery2's Items

    2)where does Notes come from? parent entity or child entity? this field's data type?

    3)what is the name of the lookup field in child enity?

    I assume that gallery1 display items in parent entity, gallery2 display items in child entity.

    If so, you should set gallery3's Items like this:

    If(variable=1,
     Filter(childentity,lookupfield.Name=Gallery1.Selected.Name),
     variable=2,
     Gallery2.Selected
    )

     

     

    Best regards,

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard