Skip to main content

Notifications

Community site session details

Community site session details

Session Id : jtT8dKNZM+q4V4pwfkmxVL
Power Apps - Building Power Apps
Suggested answer

Collection on nested gallery does not collect any rows, but there is no error on the formula

Like (1) ShareShare
ReportReport
Posted on 11 Mar 2025 22:35:22 by 79
Help is appreciated. I have a gallery 'galJobInv' and nested gallery 'galContItems'. 
Datasource for galJobInv is a collection with GroupBy. The grouped data name is 'BillHeaderData'.
For nested gallery 'galContItems', the Items property formula also uses a GroupBy statement: 
SortByColumns(GroupBy(ThisItem.BillHeaderData, BillID2, CINum, DEETS),"CINum",SortOrder.Ascending)
I need to create a csv file with 1 concatenated row for each parent and child gallery row. The OnSelect property of a button will get the data from each gallery, group and sort the data, and trigger a flow to create a csv file. All is working except for code below to get the concatenated rows from the nested gallery data. There is no formula error in power apps, but no rows load into the collection. I can see (screenshot below) that the nested gallery 'galContItems' name in the formula is not becoming color coded and italicized as it normally would. 
 
What is wrong?
ForAll(
    galJobInv.AllItems,
    Collect(
        colMergedCI,
        DropColumns(
            AddColumns(
                galContItems.AllItems,
                BillID3,
                gjiBillID2.Text,
                Distribution,
                Concatenate("D,1," & gjiCItem.Text & "," & gjiJob.Text & "," & ",,,,," & gjiBilledUnits.Text & "," & gjiBillTtl.Text & ",")
            ),
            BillID2,
            CINum,
            DEETS,
            gjiBilledUnits,
            gjiBillTtl,
            gjiCItem,
            gjiUprice,
            gjiJob,
            gjiBillID2
        )
    )
);
Categories:
  • Suggested answer
    Michael E. Gernaey Profile Picture
    36,186 Super User 2025 Season 1 on 16 Mar 2025 at 01:46:55
    Collection on nested gallery does not collect any rows, but there is no error on the formula
     
    I am going to... this is going to sound bonkers and like ya right... but
     
    There was (and not sure if it was ever fixed) an issue where accessing Child data via scoped down from Parent, would NOT cause an error but the data would be blank WHEN you tried to write out Gallery data, even though you could see it.
     
    2 different possible solutions.
     
    1. use an Alias for both the Parent and the Child, this works sometimes, cannot tell you why and why not
     
    parentgallery.AllItems as Parent_Gallery and do the same for gallery, then access stuff using the alias
     
    2. you have to add some ridiculous column and control into the parent.. like a text box and the text box actually represents some data in the child.. like count of rows under it, it doesn't even have to be visible, just there
     
    So for kicks add a Label. in it put the count(child rows for this parent). Make it visible at first just to see if you see values. Then test it
     
    And bingo.. .child data would start appearing
     
    PS FYI for option 2. I noticed that if i did this AND used Aliases, it barely ever worked, so I took away the alias..
     
    But :-( give them a try.

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,442 Most Valuable Professional

Leaderboard
Loading started