cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Post Partisan
Post Partisan

Collect with GroupBy.. what is wrong

Hi there,

 

For a Button OnSelect, i am writing the below code. But Powerapps showing error.

Not able to isolate what is wrong. Please assist.

 

ClearCollect(TempGroup,
AddColumns(
GroupBy(
Filter(SAL_DAILY, campus = ddcampus_1.Selected.Value && Attendance_date = adate_1.SelectedDate),
"OData__x0035_30AM",
"530AMGroup"
),
"530AMCount",
CountRows(530AMGroup)
);
)

 

venka91_0-1638591472462.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @venka91 ,

See below - when you use a number to start an element name, it needs to be in single quotes.

ClearCollect(
   TempGroup,
   AddColumns(
      GroupBy(
         Filter(
            SAL_DAILY, 
            campus = ddcampus_1.Selected.Value && 
            Attendance_date = adate_1.SelectedDate
         ),
         "OData__x0035_30AM",
         "530AMGroup"
      ),
      "530AMCount",
      CountRows('530AMGroup')
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @venka91 ,

See below - when you use a number to start an element name, it needs to be in single quotes.

ClearCollect(
   TempGroup,
   AddColumns(
      GroupBy(
         Filter(
            SAL_DAILY, 
            campus = ddcampus_1.Selected.Value && 
            Attendance_date = adate_1.SelectedDate
         ),
         "OData__x0035_30AM",
         "530AMGroup"
      ),
      "530AMCount",
      CountRows('530AMGroup')
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

venka91
Post Partisan
Post Partisan

Oh.. i never expected... 

But this collection got me two records based on "Yes" and "No" Result.

 

Is that possible i can display only "Yes" count into gallery.

 

 

@venka91 ,

Which field contains the Yes/No values and is this a Text or a Yes/No field type? You simply need to add that to the Filter.

venka91
Post Partisan
Post Partisan

Thank you for your suggestion. Applying filter resulted me with the desired result. I am very thankful to you.

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,243)