cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StevenO
Regular Visitor

PowerApps SQL Collection doesn't collect all data

I have a SQL table with 15 columns as a data source within my app.  Here is the filter I'm using, and I can view all 15 columns within a Gallery.  

 

Filter(
    '[dbo].[RE_GiftDetail]',
    BatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
)

 

 

I have a "Batch" gallery with a checkbox that adds a batch to a gallery, then I use AddColumns to add this data to a column called "GiftDetails".  It is working, but only collecting 3 columns.  If I view the collection, the rest of the columns are present, but blank.

 

ClearCollect(
    DetailsCollection,
        ThisItem.GiftBatchNumber
);

Collect(
    ItemsCollection,
    AddColumns(
        DetailsCollection,
        "GiftDetailTotalAmount",
        Sum(
            Filter(
                '[dbo].[RE_GiftDetail]',
                BatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
            ),
            GiftSplitAmount
        ),
        "GiftDetailCount",
        CountRows(
            Filter(
                '[dbo].[RE_GiftDetail]',
                BatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
            )
        ),
        "GiftTotalAmount",
        Sum(
            Filter(
                '[dbo].[RE_Gift]',
                GiftBatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
            ),
            GiftAmount
        ),
        "GiftCount",
        CountRows(
            Filter(
                '[dbo].[RE_Gift]',
                GiftBatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
            )
        ),
        "GiftDetails",
        
		Filter(
			'[dbo].[RE_GiftDetail]',
			BatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
		),
        "PostDate",
        ThisItem.PostDate,
        "PostStatus",
        ThisItem.PostStatus
    )
)

 

 

Likewise, if I add this data directly to a collection, I only get 3 columns.

 

ClearCollect(
    GiftDetailRecords,
    Filter(
        '[dbo].[RE_GiftDetail]',
        BatchNumber = Gallery_RE_BatchItems.Selected.GiftBatchNumber
    )
);

 

Can anyone assist?  Thanks in advance. 

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,050)