Cascading Dropdowns; Duplicate Entries

Mar 22, 2011 at 2:51 PM
Edited Mar 22, 2011 at 3:05 PM

Hi all,

Can anyone advise me if there's a way to remove duplicate entries from the CascadingDrop Down functions.  Infopath has something similar to this in its drop down box properties, the "Show Entries only with Unique Display Names", which removes all doubled entries.

I've seen a blog on what I think details what I'd like to achieve, on this link (http://tipsinsharepoint.wordpress.com/2010/06/24/3-level-cascading-dropdowns-in-sharepoint-remove-duplicate-records/), which I can see it applicable for 5.4 only.

With the code rework with version 0.60 I'd still like to ask if there's a way to do this via the native SPServices, rather than having to edit the CAML.

Coordinator
Mar 22, 2011 at 3:11 PM

No, the function doesn't provide an option to remove duplicates. You should manage the values in the relationshipLists.

I hadn't seen the post you refer to above before, but it's a really roundabout way of fixing something which is actually a data problem. Also, keep in mind that the changes suggested will apply to ALL calls to SPCascadeDropdowns. Finally, he edits the minified version of the code. Boy does that make it harder!

M.

Mar 22, 2011 at 3:46 PM

Hi Marc,

You must be an early riser!

Can you give me an example of what you mean by manage the value in the relationship lists?

Looking at the Sympaxis example, the duplicates in the country column aren't fed through into the site demo.  Is this entirely down to the way the source lists arrange their data?

Coordinator
Mar 22, 2011 at 3:53 PM

It's not early where I am. Or late. It's right in the middle. ;+)

There aren't any duplicates in the Countries list. For this to work well, you'll want to take a very relational approach to the relationship lists.

M.

Mar 22, 2011 at 3:56 PM

And here I am with normalised tables.  The joy.  I see what you've done with the demo lists, the regions list looks up into the countries list, whereas I've stuffed a load of single line columns into one list.  I'll rejig it as per the demonstration.

Coordinator
Mar 22, 2011 at 3:59 PM

As you probably know, there are benefits to taking the relational approach. If you build these columns as Site Columns in the root site of the Site Collection, then you can reuse them all over the place. You can also wrap some approval and/or workflow around the lists., etc. You can also add other descriptive information to the lists beyond just what you need for this use case. Lots of power ensues.

M.