Hi All,
Can you guys please help how do I get list of Ids containing duplicates values in list of objects containing duplicate values. The list always has duplicate values.
This is the list
locallist: {
{ id:12, FacilityName:"New Test1", FacilityTypeId:8,},
{ id:13, FacilityName:"New Test0", FacilityTypeId:9,},
{ id:14, FacilityName:"New Test1", FacilityTypeId:8,},
{ id:15, FacilityName:"New Test0", FacilityTypeId:9,},
}
what I want to get list of ids containing duplicates. So in this case, id 12, 14 are duplicate having same FacilityName, FacilityTypeId. And id 13, 15 are duplicate having same FacilityName, FacilityTypeId
local!ResultList: { { 12, 14 }. {13,15} }
Any help would be appreciated
Discussion posts and replies are publicly visible
a!localVariables( local!list: { { id:12, FacilityName:"New Test1", FacilityTypeId:8}, { id:13, FacilityName:"New Test0", FacilityTypeId:9}, { id:14, FacilityName:"New Test1", FacilityTypeId:8}, { id:15, FacilityName:"New Test0", FacilityTypeId:9} }, local!updatedDictionary: a!update( data: cast(a!listType(type!Map), local!list), index: "id", value: repeat(length(local!list), null) ), local!uniqueList: union( local!updatedDictionary, local!updatedDictionary ), a!forEach( items: local!uniqueList, expression: index( index(local!list, "id", null), wherecontains( fv!item, local!updatedDictionary ), {} ) ) )