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 / accessing grouped data
Power Apps
Answered

accessing grouped data

(0) ShareShare
ReportReport
Posted on by 22

Hi

 

I trying to group info in a collection and access and display it on a gallery like below.

 

This is my collection Planning

This is the datasouce PlanningThis is the datasouce Planning

After grouping information by using ClearCollect(byName,GroupBy(Planning,"Name","Rest")), I got the followinggroupby.PNG

 

Rest column I got the following:

Rest.PNG

 

My question is:

How can I display information in a gallery as below?

gallery.PNG

 

Many thanks

 

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

    @Muganga 

    Set your Items property of your Gallery to:

    GroupBy(Planning, "Name", "_recs")

     

    Place a labels in the Gallery row and set as follows:

    Label1.Text :  ThisItem.Name

    Label2.Text :  With({_val:Concat(ThisItem._recs, Cert & ", ") }, Left(_val, Len(_val)-2))

    Label3.Text :  With({_val:Concat(Sort(ThisItem._recs, Expire), Expire & ", ") }, Left(_val, Len(_val)-2))

     

    I hope this is helpful for you.

  • Muganga Profile Picture
    22 on at

    Thank you for your prompt answer. It worked perfectly.

     

    - How could I have column 2,3 and 4 sorted ascending and get the earliest date displayed?

     

    Before

    aaa         2          1          3           4/12/21, 9/09/21, 22/06/21
    bbb        3          2                      7/10/21, 2/01/21
    ccc         2          1                       6/07/22, 13/12/21

     

    After

    aaa         1          2          3           22/06/21
    bbb        2          3                       2/01/21
    ccc         1          2                       13/12/21

     

    I was wondering not being possible get the earliest date after using concat as this function work with string format variable. Am I right?

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Muganga 

    No problem!

    Change your labels in the Gallery row and set as follows:

    Label1.Text :  ThisItem.Name

    Label2.Text :  With({_val:Concat(Sort(ThisItem._recs, Cert), Cert & ", ") }, Left(_val, Len(_val)-2))

    Label3.Text :  First(Sort(ThisItem._recs)).Expire

     

    This will give you the Certs sorted ascending and the earliest date displayed.

  • Muganga Profile Picture
    22 on at

    Excellent RandyHaves

     

    For Certs...did work perfectly however still struggling with the earliest date.

     

    I tried With({_val:Concat(First(Sort(ThisItem.rest, EXPIRE_DATE), EXPIRE_DATE & ", ")).EXPIRE_DATE}, Left(_val, Len(_val)-2))

     but did not work!

     

    I tried using only as you suggested 

    Label3.Text :  First(Sort(ThisItem.rest)).EXPIRE_DATE

    but did no worked.

     

    Pretty sure it is something I am doing wrong with FIRST function.

     

    thanks again for your help

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard