Duplicate Values in Child Dropdown - Multi Value issue?

Dec 30, 2009 at 4:02 PM

I have two lists. Projects and Tasks.

I have set cascading dropdowns where Projects is the Parent and Tasks is the child.

        relationshipList: "Project Tasks",
        relationshipListParentColumn: "Project",
        relationshipListChildColumn: "Title",
        parentColumn: "Project",
        childColumn: "Project Task"

It is working except that my child list shows duplicate entries. Duplicates are in random amounts which was weird. So in my child list I would have for example, Task 1 listed twice, Task 2 listed 4 times, and Task 3 only listed once. After digging around I found that the # of duplicates in my child list where showing up because my Task list has a multi-value column (Group). So a task is being listed based on how many groups the task is assigned to. The lookup column for the child is based on the Title column so how is my multi-value column affecting this lookup? Is there a filter or CAML GroupBy or something to keep the multi-value column from affecting the Title lookup dropdown?

By the way both Project and Title are single value columns only.

Dec 30, 2009 at 4:21 PM

Hmm. Not sure based on what you've told me so far.  Can you show me what the data in the "Project Tasks" list looks like?  As long as there is only one entry per task, you should only be seeing each value once.


Dec 30, 2009 at 5:06 PM

My setup seems to be just like the examples except that my Task list contains a multi value column (Group). I created a Related Links list to allow users to associate URLs to the Project or task. This is where I've added the Cascading Dropdowns (Project / Project Task). Like I said it works but I get duplicates in the Project Task Dropdown. I looked through my Task List and each time, the number of duplicates in the dropdown matched the number of items in the "Group" column. If I assigned the task to 3 groups it's in the Project Task dropdown 3 times when I select the Parent Project. 

The only 2 lookup items in the Related Links list are Project Name from Projects and Title from Tasks.

Project List
Project Name 
Start Date 
End Date 
Budget in Days 
% Complete 

Task List
Project - Lookup column based on the Project Name column of the Project List
Start Date 
Due Date 
Group  - (Multi Value) groupA; groupB; groupC
% Complete 
Date Completed

Related Links
Title  - Mandatory
Link  - Mandatory
Project  -  Mandatory / Lookup column based on the Project Name column of the Project List
Project Task - Optional / Lookup column based on Title column of the Task List

Dec 30, 2009 at 7:16 PM

So is it the Related Links list that you are using in SPCascadeDropdowns?  You show a different list name in your initial post.

If it is the Related Links list, then you don't want to have Project Task optional, do you, since that is the column you are using in the function? 


Dec 30, 2009 at 8:36 PM

The idea is that a member enters a Project, then adds Tasks to the Project. After a Project is created they can click a link to add a related URL. In the Related Links List, I made Project Lookup Column Mandatory and Project Task Lookup Optional so that they can add a URL at the Project level and optionally at the Task level. Then when they view the Project it will show ALL URLs that have that Project associated. When they view a Task it will only show URLs if they have both a Project (Mandatory) and a Task (Optional) associated. Kind of a 2fer.

So my SPCascadeDropdowns are on the NewForm.aspx of the Related Links List which has 2 lookup columns, Project and Project Task. Project being the Parent and Project Task being the child.

        relationshipList: "Project Tasks",              <--- The Tasks List
        relationshipListParentColumn: "Project",  <--- The Project Column in the Task List
        relationshipListChildColumn: "Title",        <--- The Title Column in the Task List
        parentColumn: "Project",                        <--- The Project Dropdown in the NewForm.aspx for the Related Links List
        childColumn: "Project Task"                   <--- The Task Dropdown in the NewForm.aspx for the Related Links List

Have I not set this up correctly?

Dec 31, 2009 at 2:43 PM

I *think* I'm following you here. It's always a little hard to debug this stuff remotely unless they are just syntactical issues.  You really need to dig into the data to be sure.

So your list Project Tasks list must be the Task List that you show in your prior post?  Based on the way you have things set up, you should see one entry in the Project Task child column for each item where the Project column in Project Tasks matches the selected Project on the Related Links NewForm.


Dec 31, 2009 at 4:22 PM

You are correct, Project Task is Task List. My fault.

I found the issue! Don't know how I'm going to get around it, but I found the issue.

I have a site column in my Project Tasks List "Assigned To" (Which I forgot to add in my post above). In the properties of the Assigned To Column, I have checked the "Allow Multiple Selections" box because more than one person may be working the task. Unfortunatly, I can't turn the multi selection off because it is already in use.

I recreated new lists in my test environment and added a Multi Select "Assigned To" Column to the SPCascadeDropdowns child list and it show duplicates. I unchecked the "Allow Multiple Selections" and boom, no duplicates in the child listing.

If you want to recreate this bug, glitch, loophole... whatever you want to call it. Add the "Assigned To" site column with "Allow Multiple Selections" checked to your SPCascadeDropdowns child list.

Fill in the new Assigned To column with more than one persons name and then view the NewForm where you have your SPCascadeDropdowns... duplicate entries should appear in your child dropdown.

Now, all I have to do is figure out how to keep my "Multiple Selections" but remove the duplicates in the SPCascadeDropdowns child dropdown.

Dec 31, 2009 at 4:59 PM
Edited Dec 31, 2009 at 6:44 PM
My guess is that you are ending up with a task per Assigned To, so it seems like you have duplicates. You could do some post-processing with completefunc to remove the duplicates, I suppose. Maybe I should add a 'removeDuplicates' option on the function, but in this case they probably aren't true duplicates.
Dec 31, 2009 at 6:18 PM

Seems like I always find the obscure issues. Thanks for the help and if you find a workaround, let me know.

Dec 31, 2009 at 6:45 PM

Check to see if you do indeed have multiple tasks with the same Project.  I'd make sure that the data is what you think before I went any further.


May 6, 2010 at 1:23 PM
Edited May 6, 2010 at 2:19 PM

Marc, I am wondering about possible bug here. I hope I can explain it. I too have been having a problem with duplicate values in child list and the above post gave me a hint as to what might be wrong. In my case the child list has a SharePoint column/field in it that uses a "multi-select" dropdown list, now this column is not being used for the cascade itself (the title column is being used in my case). Every time I add another item from the multi-select and save the list item, it adds a duplicate record of that list item's title to the child drop down list, despite there only being one record. If I edit the list item and remove the multi-select items and save the duplicates disappear. I have just updated my script to the 0.5.4 version and still have the same problem.

May 6, 2010 at 2:02 PM


Let's see if we can sort through this. I'm going to copy your post into a new thread...