09-18-2023 10:48 PM
Hello Experts,
I have below Object input containing string values. Can someone please provide expression to get rid of duplicate values?
[ { "ack": { "QueueURL": "https://www.google.com", "ReceiptHandle": "12345678", "content": "ABCDEFG" } }, { "ack": { "QueueURL": "https://www.google.com", "ReceiptHandle": "12345678", "content": "ABCDEFG" } }, { "ack": { "QueueURL": "https://www.google.com", "ReceiptHandle": "12345678", "content": "ABCDEFG" } } ]
Thanks in Advance
09-19-2023 09:18 AM
@aditya_gupta41 - have you tried the Unique snap?
09-19-2023 09:20 AM
@koryknick This is suppose to be an ultra task, therefore can’t use unique snap
09-19-2023 09:35 AM
If this document is the input to an Ultra task, you could use the following expression in a Mapper snap:
$.filter((val,idx,arr) => arr.findIndex(x=> x == val) == idx)
Basically, it scans through the Array and finds the first occurrence of the given value (object).