web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : lmPEaBtbA5YuB3sHXnJB+C
Power Apps - Building Power Apps
Answered

accessing grouped data

Like (0) ShareShare
ReportReport
Posted on 1 Jun 2021 17:58:40 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

 

I have the same question (0)
  • Muganga Profile Picture
    22 on 01 Jun 2021 at 23:35:59
    Re: accessing grouped data

    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

     

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 01 Jun 2021 at 21:56:22
    Re: accessing grouped data

    @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 01 Jun 2021 at 20:19:35
    Re: accessing grouped data

    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?

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 01 Jun 2021 at 18:07:44
    Re: accessing grouped data

    @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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 733 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 532 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading started
Loading complete