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 / Eliminate Child Galler...
Power Apps
Unanswered

Eliminate Child Gallery to Leave only Parent - Combine GroupBy, Sort, First

(0) ShareShare
ReportReport
Posted on by 94

I've created a setup whereby whenever a user modifies a record and hits save, the save action inserts a new record and leaves the original as it was.

 

To achieve this, every record has a Unique Record Reference - this allows me to see which records are related (any which are related have the same Unique Record Reference). Every record also has a Sequence Number. Every time a record is updated, the sequence number is incremented by 1.

 

EdwardHodson_0-1703332576143.png

 

 

I want the gallery to only displays records of the latest sequence number.

 

I have achieved this by using a parent and child gallery. The parent gallery carries out the "GroupBy" action. It groups the records by Unique Record Reference:

 

GroupBy('PowerApps Version Testing EH',"UniqueRecordReference","DATA")

 

 

The child gallery does the rest, which is to sort by Sequence number, then get the latest sequence number only:

 

First(Sort(ThisItem.DATA, Sequence, SortOrder.Descending))

 

 

I'd like to avoid having a parent and child gallery. Instead, perform the above in just a parent gallery. Is this possible?

 

Thank you.

 

Ed 

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    I frequently use an HTML text control as a stand-in for galleries, particularly to avoid issues that come from using child galleries.

     

    The Text property is filled with a Concat() that appends "<br>" to the end of each record to create a gallery-like appearance.

     

    That said, it seems like you only want to display a single record from your child table - why not have a label (or more than one if necessary) in your parent gallery that does that? the Text property would look something like:

    First(Sort(ThisItem.DATA, Sequence, SortOrder.Descending)).myFieldName
    

     

    Hope that helps,

    Bryan

  • EdwardHodson Profile Picture
    94 on at

    Hi Brian @BCLS776 

    Thanks for your reply. I may not have explained myself well enough. Here are a couple of screenshots which may do a better job.

     

    The below shows the sorts of record that should be and should not be displayed in the app. For each Unique Record Reference record, I only want the record with the latest Sequence number to be displayed, as shown below:

     

    EdwardHodson_0-1703410904978.png

     

    The UI of the app itself currently has a gallery to the right (this is shown before I added Parent and Child gallery) which after the user clicks on an item, details are displayed in the form on the left, allowing the user to update details:

     

    EdwardHodson_1-1703411071714.png

     

    Is it possible to acheive something that would work in a similar way to the above and allow the elimination of parent/child gallery with  HTML text control (I've not HTML text control before)?

     

    Thank you,

     

    Ed

  • BCLS776 Profile Picture
    8,994 Moderator on at

    An HTML text control is simply a fancy label control that lets you use HTML to do some advanced styling on the text, among other things. However, that's not necessary to do what you're after.

     

    In your case, keep your parent gallery as-is and completely eliminate the child gallery. In the parent gallery put a label with the following Text property: 

    First(Sort(ThisItem.DATA, Sequence, SortOrder.Descending)).Title
    

    Your form should have a LookUp() in its Item (not Items) property similar to:

    With({aID: First(Sort(parentGallery.Selected, Sequence, SortOrder.Descending)).ID},
     LookUp('PowerApps Version Testing EH', ID = aID)
    )
    

     That should let you select the desired item from the gallery and have the form interact with the latest Sequence number.

     

    Bryan

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard