Skip to main content
Question

Remove Duplicate rom List of String Variable

  • September 11, 2023
  • 3 replies
  • 624 views

Forum|alt.badge.img+4

Hi all,

I have a list of data type string and would like to ask is there a logic that can remove duplicate entries but keeping only one entry within the list?

The order does not matter

List
Apple
Boy
Apple
Cat
Dog

I wish to keep only 1 instance of Apple in this case.

 

Could not figure out exactly how to use the loop and a iterator to do so.

Any help appreciated.

 

3 replies

rbkadiyam
Premier Pathfinder | Tier 7
Forum|alt.badge.img+17
  • Premier Pathfinder | Tier 7
  • September 11, 2023

Forum|alt.badge.img+4
  • Navigator | Tier 3
  • January 8, 2026

Hi all,

I have a list of data type string and would like to ask is there a logic that can remove duplicate entries but keeping only one entry within the list?

The order does not matter

List
Apple
Boy
Apple
Cat
Dog

I wish to keep only 1 instance of Apple in this case.

 

Could not figure out exactly how to use the loop and a iterator to do so.

Any help appreciated.

 


You ever figure out a solution to this? The only reply isn’t very helpful. 


DS78
Most Valuable Pathfinder
Forum|alt.badge.img+13
  • Most Valuable Pathfinder
  • January 9, 2026

This is very simple. 
 

  1. Take lstInputData - duplicate values
  2. Create List type variable (lstUniqueItems) - empty
  3. Loop over inputList
  4. Check for if the value is present in lstUniqueItems: If  No → Add it 
  5. Another Loop is just to check the items in the lstUniqueItems (Not needed)
  6. Done ✅