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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,154)