I am wondering if this is even feasible to do, or if someone can suggest an alternative workaround for what I am trying to accomplish, but I have a contact database with duplicate people but with different data in certain fields. I have already filtered out the duplicates in the gallery to only display unique records based on email address, but when I go into the contact details, I want it to display the information for the entry selected (should be common across all "duplicate" records) but also have a card that displays certain fields that would be different across those "duplicate" records.
The code I used to remove duplicates in the gallery is

and the fields that would be different across the duplicate records are BuildingID and AfterHoursPriority, which are found in the AllContacts source.
I think I need to do a groupby at the gallery level and store it in a collection,
ClearCollect(AfrHrs,GroupBy(AllContacts,"EmailAddress","AfterHoursPriority"))
but then how do I ungroup it and display it at the contact details level inside a datacard, only showing the relevant fields in a table?
thanks!