Hello All,
I am having list of structure and I want to validate the list if it has any duplicate value.
Any one having any suggestions. I was trying to use foreach loop but not sure how I should implement.
Hi Neeraj,
1. Sort the list.
2. For each on sorted list
3. Compare current with previous element [current -1]
4. If current equals previous you have a duplicate
Regards,
Daniel
You can use ListDuplicate action -
see below image
Regards
Rahul
Rahul Sahu wrote:
List Duplicate action will duplicate the list in another list. I want to validate the list if it has any duplicate entry see below example:
List 1 - 1,2,3,2,4
Duplicate entry = 2
How I can achieve above ?
Daniël Kuhlmann Could you please explain in a detail or create a oml as you suggested.
I have had the same issue but resolved it in what I believe to be a simpler way.
1 - Use the ListDistinct method from the System component on the list that we wish to check.2 - If the output list of the ListDistinct has fewer records than the original, then there were duplciates.3 - provided there are duplicates and it is necessary to identify these, follow the process as laid out by @Daniël Kuhlmann (I don't need to so I just put in an error message). Using the first two steps just lets us avoid cycling through every list item unless we know there is a duplicate that needs to be found.
Hi, without foreach are any loop use can use list duplicate available in manage dependency-systems you can find list duplicate there