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 / 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
    155,922 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
    155,922 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

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 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard