Two ways of checking for duplicates:

Select creates an array of 5000 random items
1. (Left branch)
Select 2
From:
range(0, length(body('Select')))
Map:
addProperty(
body('Select')[item()],
'Duplicate',
or(
and(
not(equals(item(), 0)),
contains(take(body('Select'), sub(item(), 1)), body('Select')[item()])
),
contains(skip(body('Select'), add(item(), 1)), body('Select')[item()])
)
)
2. (Right branch)
Compose
xml(json(concat('{"Root":{"Item":', body('Select'), '}}')))
Select 2
From:
body('Select')
Map:
addProperty(
item(),
'Duplicate',
greater(
xpath(
outputs('Compose'),
concat('count(//Item[Title="', item()['Title'], '" and RType="', item()['RType'], '" and Title2="', item()['Title2'], '"])'
)
),
1
)
)
Result
Both branches result in the original array with an additional property that indicates a duplicate
{
"body": [
{
"Title": "Title-19",
"RType": "RType-213",
"Title2": "Title2-9",
"Duplicate": false
},
{
"Title": "Title-5",
"RType": "RType-179",
"Title2": "Title2-6",
"Duplicate": false
},
{
"Title": "Title-22",
"RType": "RType-303",
"Title2": "Title2-2",
"Duplicate": false
},
{
"Title": "Title-11",
"RType": "RType-106",
"Title2": "Title2-7",
"Duplicate": false
},
...
where the left branch is slightly faster
