# List Duplications

**URL:** <https://forum.kirupa.com/t/list-duplications/261966>\
**Category:** Uncategorized\
**Created:** [June 2, 2008, 6:57am UTC](https://forum.kirupa.com/t/list-duplications/261966 "2008-06-02T06:57:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashkit](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@flashkit](https://forum.kirupa.com/u/flashkit)\
**Post date:** [June 2, 2008, 6:57am UTC](https://forum.kirupa.com/t/list-duplications/261966/1 "2008-06-02T06:57:11Z")

</div>

Basically, Right now, the list duplicates users… people\_lb is the list…  
when another user logs in, it adds everyone in the room twice, or something I want the list to not add duplicates. HOW?!!?!!?

```auto

////////////////////////////////////////////////////////// manage SOs
function manageSO() {
    // Create a remote shared object to keep track of the users.
    users_so = SharedObject.getRemote("users_so", user_nc.uri, false);

    users_so.onSync = function(userList) {
        trace("onsync fires");
        // keep hold of the current selection
        var curSelection = Application.people_lb.selectedItem.label;
        
        for (var i in users_so.data) {
            if (users_so.data* != null) {
                // populate the dp
                Application.people_lb.addItem({label:users_so.data*, data:users_so.data*}); //ADD USER TO THE LIST
            }
        }
        
        var hasMatch = 0;
        for(var j=0; j<Application.people_lb.length; j++){
            trace(">>> " + Application.people_lb.getItemAt(j).label);
            trace(">>> " + curSelection);
            if(Application.people_lb.getItemAt(j).label == curSelection){
                trace(">>> match");
                hasMatch = 1;
                Application.people_lb.selectedIndex = j;
                break;
            }
        }

```
