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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Compare Two Collection...
Power Apps
Unanswered

Compare Two Collections - Return Newest Time to Gallery

(1) ShareShare
ReportReport
Posted on by 278

col_Display is my main collection.

I want to compare it to vAssignmentList

col_Display has a column called Title, that will match a column in vAssignmentList called 'Assigned To'.

For example, EngineerA could have three entries in vAssignmentList, with different 'Accept Time'.

I want to find all entries for EngineerA in vAssignmentList, and in my gallery, show the newest Accept Time.

I did something similar yesterday using As Source and that worked, but I am not able to get this to work.

CoPilot gave me this code:

ClearCollect( 
    col_Display, AddColumns(
        col_Display4 As Source, 
    GroupBy(vAssignmentList,'Assigned To'.Value,"EngineerGroup"), 
    NewAssignTime, 
    First(SortByColumns(EngineerGroup, 'Assignment Time', 
    Descending)).'Assignment Time'))

Couple of things here. Right off the bat, with using GroupBy(vAssignmentList....... It is not finding anything in vAssignmentList for some reason.

Another issue is copilot was telling me to get the newest time I then need to do another Lookup. I dont think this will work for me. I need to find the newest time and stamp that into the collection.

Then on my lable in the gallery, I would use ThisItem.NewAssignTime so I can sort the gallery based on that.

I had a kind of similar issue yesterday and the help I got is the example below which is what I am trying to implement as well on this one:

ClearCollect( 
    col_Display3, AddColumns(
        col_Display2 As Source, 
    CasesAssignedToday, CountIf(vAssignmentList, 'Assigned To'.Value = Source.Title)));
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    I am not sure of your field types here but assuming both 'Assigned to' and Title are Text.
    With(
       {
          _Times:
          AddColumns(
             GroupBy(
                Sort(
                   vAssignList,
                   'Assignment time',
                   SortOrder.Descending
                ),
                'Assigned to',
                Grouped
             ),
             Lastest,
             First(Grouped).'Assignment time'
          )
       },
       ClearCollect(
          NewCollection,
          AddColumns(
             col_Display,
             LastAssigned,
             LookUp(
                _Times,
                'Assigned to' = Title
             ).Latest
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard