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 / CDS & GroupBy maniplat...
Power Apps
Unanswered

CDS & GroupBy maniplates collections?

(0) ShareShare
ReportReport
Posted on by 482

Hey there

 

So I've been playing around with CDS as so far I'm not really convinced. At this time, I'd rather stick to SharePoint as a data source as it seems more reliable. However - and this is probably more likely - I might be doing something wrong.

 

I have created an entity called "Transactions". All the fields in this entity are text fields.

 

My problem is the following:

On App.OnStart I'm executing the following commands:

 

1) ClearCollect(colTransactions, Transactions);

 

So far so good. When I check the colTransactions collection I can see all data the way they should be. However, I'd like to group those transactions by month. That's why I'm adding the second command to the App.OnStart:

 

2) ClearCollect(colMonthsGrouped,GroupBy(AddColumns(Filter(Transactions,'Transaction Type' = "Expense"),"Month",Text('Transaction Date',"[$-en-US]mmmm")),"Month","Transactions"));

 

Once I do that, my colTransactions collection is being manipulated and loses the value for some of the fields. E.g. "name" or "category"

 

See before and after: 

problem-collections.jpg

 

Anyone knows why this is happening?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @mrQ 

    I was also playing around with your formulas and found something interesting that I could not explain.  When I tried to reproduce your issue using a collection obtained from the formula on the button as the Items property of the outer gallery, I got a null set as shown in the gallery on the left.  However, when I used 

     

    GroupBy(
     AddColumns(
     Orders,
     "Month",
     Text(
     'Order Date',
     "[$-en-US]mmmm"
     )
     ),
     "Month",
     "Transactions"
    )

     

     as the items property of the outer gallery and Transactions as the Items property of the inner gallery, it worked perfectly as shown in the gallery on the right.  I'm not sure why the collection didn't work.

    Annotation 2020-05-22 104824.jpg

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Ok, I tried again and it worked. I used GroupBy(colOrders,"Month","Transactions") as the Items property for the outer gallery and Transactions as the Items property of the Inner gallery. The formula for the collection is in the button.Annotation 2020-05-23 091753.jpg

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

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard