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)));
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
)
)
)
WarrenBelz
146,594
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional