Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Vinay T
135
Views
6
Comments
Maintain a unique list
Question
Data
OutSystems Widgets
I need a list of unique records. I can either check for duplicacy before entering a new record, OR I could remove all the duplicates at the end.
What's the most efficient way to do it? Is there a implementation available for the SET abstract data type?
Kilian Hekhuis
MVP
It depends I think what kind of unique record list this is, how many elements it has etc. For example, you could use the TextDictionary system extension to maintain in parallel a dictionary for easy and efficient checking of duplicates.
Vinay T
It is a record list. And it'll have 0-100 elements.
Kilian Hekhuis
MVP
And how often do you need to insert one, i.e. how often do you need to check for duplicates? And where are those records coming from?
Vinay T
The records are coming from different aggregates. Also, I don't really need to check for duplicates after every insert, I just need a unique list at the end.
The insert operation doesn't happen frequently as it is a small list.
J.
MVP
Imho make it simple with a for each check. If that is becoming too slow, refactor it.
Kilian Hekhuis
MVP
Vinay,
The easiest way to ensure there are not duplicates is to check before adding. You can indeed follow up J's recommendation if it's infrequent and the list small, or when that becomes too slow, use TextDictionary to avoid duplicates.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...