Duplicates in cascade dropdown

Jul 29, 2011 at 1:45 PM

First of all, thank you for an excellent script.

I am not a coder by default but have been working and customizing sharepoint sites for a year now. I have been implementing your script in an internal site with 3 lists:

client

project with client lookup

and task with client and project lookup.

The problem i am having is that i am getting duplicates in the dropdown for the client in the first cascade. the filtering is working fine, it is just that if a client has 5 projects his name will show 5 times. If i select any of them the rest of the dropdowns work ok.

I found a few entries with similar issues in the discussions but nothing helped.

 

To test it out i removed all non essential code and tried just one cascade and the reults are the same. The code is:

<script type="text/javascript" src="../../../Shared%20Documents/Systemfiles/jquery-1.6.1.min.js"></script>  

<script type="text/javascript" src="../../../Shared%20Documents/Systemfiles/jquery.SPServices-0.6.2.min.js"></script>  
 
<script type="text/javascript">  
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "{4E0F1FE8-EAFE-4D65-9305-A476E97D504A}",
			relationshipListParentColumn: "Client",
			relationshipListChildColumn: "Title",
			parentColumn: "Client",
			childColumn: "Project",
			debug: true
		});
});
</script> 

The only logic i can see causing the issue is that i use the GUID for the relationship list, otherwise following the example with cities and regions the setting are the same. For some reason it cannot find my "projects" relationship list but i am content with GUID as long as it works.
Am i right that this could be the issue?
All help appreciated.
Peter
Coordinator
Aug 1, 2011 at 4:32 AM

Peter:

The most likely cause of the duplicates is the data you have in your lists. Using the GUID shouldn't matter. Without seeing your list data, it's hard to say what's going on, but I'd check that you have exactly one item per client in the Clients list, exactly one item per project in the Projects list, and exactly one item per task in the Tasks list.

M.

Aug 5, 2011 at 3:02 PM

Marc,

 

Thank you for your reply. Sorry for the delay i had a few days off. Since the database is in use and the original setup was "messy" i have decided to rebuil the site in a cleaner format. I will come back to you if the issue persists however i am almost certain that with new clean relationship lists, the issue will resolve.

 

Thanks for your time.

 

Peter

Coordinator
Aug 7, 2011 at 4:58 PM

Peter:

Sure thing. Let me know how it goes!

M.

Oct 28, 2011 at 8:41 PM

I have the same the problem with almost the same scenario and code. If I was using the example in the documentation and only used the Regions List for Country and Region, my Country drop-down would show "United States" 5 times and "Canada" 2 times. The Regions would display properly based on the Country selection.

Coordinator
Oct 28, 2011 at 8:49 PM

TeenerTim:

If your list looks like the image you show and the script follows the example, then you should only see each Country once.

M.

Oct 28, 2011 at 9:12 PM

Thanks for the fast reply Marc.

Maybe the confusion is with the columns I created.
If we're using the example above, I have a site column named Country that is a lookup column pointing to the Region List using Country as the value.
I also have a site column named Region that is a lookup column pointing to the Region List using Title as the value.

With this setup I see all 8 of the Country entries but the Region filters fine once I choose a Country.
I'm new to this and I didn't see anything in the documentation that described how the columns on the form should be set up.

Tim

Coordinator
Oct 28, 2011 at 9:16 PM

The Country column in the "form list" should be a lookup to the Title (Country) in the Countries list.

The Region column in the "form list" should be a lookup to the Title (Region) in the Regions list.

You're building relational tables, just as you'd have in good database design.

M.