I'm calling listdata.svc a few times with different URL's depending in what is selected, I have some issues with the parameters/filters.

First URL:

var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=ApprovalStatus eq '0'&top=2&orderby=Modified desc";

This one only get items that are approved but it ignores the top and orderby, what am I doing wrong here? I've tried with various combos of moving the parameters around ,use &$ etc.

Second URL:

var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=substringof('" + keyword + "',Keywords)";

This one works but I can't get it to only get items with the keywords AND are published, ordered by Modified.

Third URL:

var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=ApprovalStatus eq '0'&$skip=" + displayedItems + "&top=1";

This one get only approved items but ignores skip and top.

Any suggestions?

Thanks in advance.\

Update: Looks like:

            function (data) {
                function (i, result) {

causes the error when I use &$top in the URL..

Edit2: Ok so when I use top I have to do $.each(data.d, instead of $.each(data.d.result,

  • Most of your parameters are missing $: $orderby, $skip, $top Oct 2, 2012 at 7:34
  • updated my post with another url
    – John
    Oct 3, 2012 at 1:16

1 Answer 1


To get information order by a parameter and filtered with a specify word you can do something like this:


this is an example that I got from MSDN and I used it for my purpose and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.