How to check duplicates in list - OutSystems 11
Question

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. 

mvp_badge
MVP
Solution

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


mvp_badge
MVP

Hi Neeraj,

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 ?



Hi Neeraj,

You can use ListDuplicate action -

see below image



Regards

Rahul

 

 

mvp_badge
MVP
Solution

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


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.