SPServices.SPFilterDropdown Error

Mar 24, 2014 at 4:47 PM
I am not sure why my code is not working. I have searched through the other discussions and believe that my code is correct and I am still receiving an error

"Error in function
SPServices.SPFilterDropdown
Parameter
relationshipListColumn: Title
Message
Not found in relationshipList Operational Period
Click to continue""

My setup is two lists and I want to filter the value based on a choice column. In the relationship list I have two fields one is the Title Column, renamed to "Operational Period" and the other is the choice column "Show in Dropdown?"

In my current list the lookup column (also a site column so that I can reuse the code) is named "Operational Period".

Here is the code.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 

<script language="javascript" type="text/javascript" src="http://beach/SiteCollectionDocuments/jquery.SPServices-2014.01.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {
$().SPServices.SPFilterDropdown({
  relationshipList: "Operational Period",
  relationshipListColumn: "Title",
  columnName: "Operational Period",
  CAMLQuery: "<Eq><FieldRef Name='Show in Dropdown?'/><Value Type='Text'>Yes</Value></Eq>",
  completefunc: null,
  debug: true
});
});

</script>
Could the reason that this is not working be because the lookup column is a site column?

Thank you for your help
Mar 31, 2014 at 4:20 PM
Has anyone ever come across this issue?
Coordinator
Mar 31, 2014 at 4:55 PM
Your CAMLQuery needs to use the StaticName of the column. Odds are that in this case it is something like "Show_x0020_in_x0020_Dropdown", but it's hard for me to say. If you edit the column in the list settings, you'll see the StaticName double encoded on the URL.

M.
Mar 31, 2014 at 8:21 PM
Marc,

I changed the CAMLQuery and replaced the 'show in dropdown' with 'Show%5Fx0020%5Fin%5Fx0020%5FDropdown%5Fx00' and then tried "Show_x0020_in_x0020_Dropdown" as you recommended but I am still receiving the same error message each time.

Error in function
SPServices.SPFilterDropdown
Parameter
relationshipListColumn: Title
Message
Not found in relationshipList Operational Period
Click to continue""

Is there a hidden ID for a site column besides clicking edit in site settings and coping the name at the top?
Coordinator
Mar 31, 2014 at 9:20 PM
You're close.

'Show%5Fx0020%5Fin%5Fx0020%5FDropdown%5Fx00'

translates to:

'Show_x0020_in_x0020_Dropdown_x00'

M.
Marked as answer by DHowellBrevard on 3/31/2014 at 1:37 PM
Mar 31, 2014 at 9:37 PM
Thank you for your help!

-Dylan