cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamesbbrown
Frequent Visitor

GroupBy AddColumns Gallery

Hi,

I've been battling with a 'complex' issue for a few days, and after watching various videos on YouTube and scouring the forum, I've now decided it's time to ask for help myself.

 

I have an SP list that stores training reports. I would like to group these by person and then open another window to show a complete list.

 

So far, I've managed to display the data by GroupBy and also add a CountRows feature. Code currently working below.

 

 

 

 

AddColumns(
    GroupBy(
        'Training Records',
        "Title",
        "TrainingRecords"
    ),
    "CountRecords",
    CountRows(TrainingRecords)
)

 

 

 

 

 

What I now need is to add columns to the table so I can complete the gallery. This is where I'm stuck and could do with help! Below is a table of what I want to include.

 

CountRecordsTitleTrigraphServiceNoArrivalDateFutureAvailLastRecordDateLastRecordPositionTrainingRecords
"CountRecords", CountRows(TrainingRecords) "Title" Trigraph", Trigraph.Value,ServiceNo", '0.2.3. Personnel Service No.'.Value, ArrivalDate", '0.2.1. Personnel Arrival Date'.Value,FutureAvail", '0.2.1. Personnel Future Availability'.Value

HELP! Code needed!

Date of last training record HELP!

HELP!

Code needed!

Last('0.7. RECORD TYPE'.Value)?

TABLE

 

Really appreciate any help on this!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @jamesbbrown ,

Bear in mind here that there are several matching record field values for each group, but if you want the first one back

AddColumns(
   GroupBy(
      'Training Records',
      "Title",
      "TrainingRecords"
   ),
   "CountRecords",
   CountRows(TrainingRecords),
   "Title",
   First(TrainingRecords).Title,
   "ServiceNo",
   First(TrainingRecords).ServiceNo,
   . . . . . . .
)

 

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

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @jamesbbrown ,

Bear in mind here that there are several matching record field values for each group, but if you want the first one back

AddColumns(
   GroupBy(
      'Training Records',
      "Title",
      "TrainingRecords"
   ),
   "CountRecords",
   CountRows(TrainingRecords),
   "Title",
   First(TrainingRecords).Title,
   "ServiceNo",
   First(TrainingRecords).ServiceNo,
   . . . . . . .
)

 

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

@WarrenBelz 

I might ask for your number so I can add it to speed-dial #1.

You've got me out of a jam once again and I'm hugely grateful!

@jamesbbrown ,

Not something  I share publicly, but happy to help if you tag me, have a go at some code and it is something within the area I operate (SharePoint-based)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,845)