Hi @JSeymour
Collect data from both lists and add a common identifier for the names.Combine the collections into one.
Use the GroupBy function to group the data by the common identifier.
Extract the necessary information from each group.
// OnStart property of the app
ClearCollect(
CombinedLeavers,
AddColumns('List1', "DisplayName", StaffName.DisplayName, "UniqueID", StaffName.Email),
AddColumns('List2', "DisplayName", Name.DisplayName, "UniqueID", Name.Email)
);
// Group by the unique identifier (e.g., Email) and then extract other data
ClearCollect(
GroupedLeavers,
GroupBy(CombinedLeavers, "UniqueID", "DisplayName", "GroupData")
);
// Now, create a collection that contains distinct names and other data
ClearCollect(
DistinctLeavers,
ForAll(
GroupedLeavers,
{
DisplayName: DisplayName,
OtherData1: First(GroupData).OtherColumn1,
OtherData2: First(GroupData).OtherColumn2
// Add other columns as needed
}
)
);
// Set the gallery's Items property to the DistinctLeavers collection
Gallery1.ItemsSource = DistinctLeavers
In the gallery, you would then use labels with the Text property set to ThisItem.DisplayName, ThisItem.OtherData1, ThisItem.OtherData2, etc., to display the data.
Note that this approach assumes that the UniqueID (in this case, the email from the People Picker field) can be used to identify distinct individuals across both lists. If this is not the case, you'll need to adjust the logic to correctly identify distinct records.
Thanks!
If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.