Skip to main content
Cadet | Tier 2
September 11, 2023
Question

Remove Duplicate rom List of String Variable

  • September 11, 2023
  • 3 replies
  • 768 views

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
Premier Pathfinder | Tier 7
September 11, 2023
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
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 ✅

 

 

🤝Let's connect on LinkedIn: https://www.linkedin.com/in/dipendra-shekhawat/ >>>>>>>>>>>> 📺Check out my YouTube channel - https://youtube.com/@AutomationFeed