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 / Connect Nested Galleries
Power Apps
Answered

Connect Nested Galleries

(0) ShareShare
ReportReport
Posted on by 59

I have a nested gallery: glyUnitCount

Items: GroupBy(AddColumns(Filter(AttendanceData,Program=varProgram,YRweekNumber=lblYrWeekNum_1.Text,P_or_A="P"),"UnitNum",LookUp(colAlist,Name = AttendeeName,NumberOFUnits)),"AttendeeName","UnitNum","UnitbyAttendee")

 

Parent gallery: glyDaily 

Items: Filter(colAlist,End_Date>=dtAttendanceDate.SelectedDate And Start_Date<=dtAttendanceDate Or IsBlank(End_Date),Program=varProgram)

 

My Data is a Sharepoint List.... AttendanceData, and a Collection.... colAlist.

I can not seem to get the syntax correct to tie them together by AttendeeName.  This does not have to be nested galleries but I can't figure out how to combine the two.  Essentially I need the filter from the Parent gallery to filter the nested gallery.

Any suggestion is appreciated!

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @elkay73 

    I'm just trying to understand what you are trying to achieve here. Is the aim to get the Parent gallery to display the related data from AttendanceData? Could you provide an example of your end goal.

     

    In the interim and as a suggestion, you could try using ThisItem in your nested gallery, like this:

    GroupBy(
     AddColumns(Filter(
     AttendanceData,
     Program=ThisItem.varProgram,
     YRweekNumber=lblYrWeekNum_1.Text,P_or_A="P"),
     "UnitNum",ThisItem.NumberOFUnits),
     "AttendeeName",
     "UnitNum",
     "UnitbyAttendee"
    )

    Essentially, you can reference the Parent gallery inside the nested gallery by using ThisItem, hence all of the Parent gallery data is available to use via this method.

     

     

  • elkay73 Profile Picture
    59 on at

    @Anonymous 

    End result is to know if there are units left to use.

    Each week an AttendeeName has a NumberOFUnits.  These are stored in the collection colAlist.  I then need to count the UnitbyAttendee  (this is a count of records from AttendanceData sharepoint list that match the Program and AttendeeName) used for a given weekAnd subtract that from the NumberOFUnits.  So basically colAlist.NumberOFUnits - UnitbyAttendee = Units remaining.  While filtering by the chosen dropdown Program.  

     

    I tried your code and I get a warning that 'This formula uses scope, which is not presently supported for evaluation.

    This warning for both "ThisItem." codes.

    I was able to change one from Program = ThisItem.varProgram, to Program = varProgram.  And that helped.  

    I want to see just the matching Attendee's info in the sub gallery so would a Lookup be appropriate/helpful?

  • elkay73 Profile Picture
    59 on at

    Ugh, I just noticed by NumberOFUnits is not being added as a the correct values for AttendeeData.  It is populating a column but the value is only the first available.  I don't understand why it's so difficult to combine 2 sources that have a common field.

  • elkay73 Profile Picture
    59 on at

    Update...I've tried to simplify things... I now have these galleries...

    glyUnitCount

    GroupBy(Filter(AttendanceData,Program=varProgram,YRweekNumber=lblYrWeekNum_1.Text,P_or_A="P"),"AttendeeName","UnitbyAttendee")

     

     

    Parent gallery: glyDaily 

    Sort(Filter(colAlist,End_Date>=dtAttendanceDate.SelectedDate And Start_Date<=dtAttendanceDate Or IsBlank(End_Date),Program=varProgram),AttendeeName)

    I have included the NumberOFUnits field in a label - lblNumUnit.

     

    Now I need to tie the two galleries together so that I can make the calculation "NumberOFUnits - UnitbyAttendee''

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @elkay73 

    Do you have some sample data you can show me? I'm still not picking up what you are putting down. You can 'join' two tables but it can either easy or difficult depending on your setup and needs.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @elkay73 

    The easiest way to do this is to use GroupBy() on the Child table and group on the foreign key. 

     

    GroupBy(ChildTable, "ForeignKey","RestOfData")

     

    You can then fill out the rest of the items in the outer Gallery by using lookups to the  Parent table, for example,

    Lookup(ParentTable, ID=Foreign key, Field1).  The subgallery Items property would be ThisItem.RestOfData.

  • elkay73 Profile Picture
    59 on at

    @Anonymous  

    I've tried cutting everything down and just don't know where to put the Lookup clause.

    Parent - glyDaily

    Items:  tblDaily

     

    Child - glyUnitCount

    Items: GroupBy(tblUnitCount,"AttendeeName","UnitbyAttendee")

    Attached is some sample data

     

     

  • Verified answer
    elkay73 Profile Picture
    59 on at

    @Drrickryp and @Anonymous 

    I was able to get it to connect with a Filter...

    GroupBy(Filter(tblUnitCount,AttendeeName=ThisItem.AttendeeName),"AttendeeName","UnitbyAttendee")

    Thank you both for your suggestions!

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 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard