This project has moved. For the latest updates, please go here.


SPFilterDropDown: Sort Descending



As a newbie, I assume I'm doing something wrong. I got SPFilterDropDown to work using column SortOrder from the parent list. However I need the list in descending order. But when i traced through the code, I could not see a way for <OrderBy>
in the camlQuery to get an "Ascending='FALSE'".

I can tweak the SPFilterDropDown and make it work using a new arguement (e.g. relationshipListSortAscending), but I'd rather not.

<script type="text/javascript"> $(document).ready(function() { $().SPServices.SPFilterDropdown({ relationshipWebURL: "/", relationshipList: "Plan Dates", relationshipListColumn: "Title", relationshipListSortColumn: "SortOrder", columnName: "Plan Date", listName: $().SPServices.SPListNameFromUrl(), CAMLQuery: "<IsNotNull><FieldRef Name='Title' /></IsNotNull>", debug: true }); }); </script>
Closed May 8, 2013 at 5:26 AM by sympmarc
Implemented in 2013.01


sympmarc wrote Feb 28, 2013 at 9:00 PM

relationshipListSortAscending option added in v2013.01, with the default value = true

fitzrandolph wrote May 9, 2016 at 8:37 PM


Have been a Big fan of your work for years now. I was hoping I could ask if SPFilterDropDown can sort descending in SP 2013 on prem? I would not put it past user error but I think I am doing it correctly...

relationshipWebURL: "/sites/raptors/", // Current site
relationshipList: "Pools", //Name of the lookup list
relationshipListColumn: "Title", //Column name in lookup list
relationshipListSortColumn: "ID", //Field I want to sort descendingly
relationshipListSortAscending: "False", //Desired Magic!
columnName: "Add to Existing Pool", //Column name in form
CAMLQuery: "<Neq><FieldRef Name='Title' /><Value Type='Text'></Value></Neq>", // Get all values by specifying a non-blank Title
debug: true // Debug mode on while we're developing

Thanks very much in advance.


sympmarc wrote May 9, 2016 at 9:51 PM


That's already in the library. I think the issue is your spelling. It should be:
relationshipListSortAscending: false, //Desired Magic!


fitzrandolph wrote May 10, 2016 at 2:22 PM

Hi Marc,

Your response was very much appreciated. I must be doing something wrong, my list wont sort descendingly. Knowing that it works on 2013 gives me hope. I will keep plugging away at it.