SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

weird but i can't figure this out or find a solution anywhere....

I want to filter on two values on a GET in REST URL from javascript. So since this is from ECMA I am just using filtering in the url...

something like:

/_vti_bin/ListData.svc/Table?$filter=Color eq 'Red'&Active eq false

doesn't work so I have tried:

/_vti_bin/ListData.svc/Table?$filter=((Color eq 'Red') and (Active eq false)
/_vti_bin/ListData.svc/Table?$filter=Color eq 'Red' and Active eq false

i know that you can only use one operator at a time in a URL but I not sure how to set two or three field filters in one URL like this

appreciate any help.

share|improve this question
Just an FYI as I know this does not pertain directly to your question, you can not filter on multi-selectable choice fields.… – Robert Kaucher Jun 26 '13 at 19:02
Thanks rob...good to know! – Justin Jun 28 '13 at 10:34
up vote 5 down vote accepted

Everywhere in this answer replace sp2010 with your site url, Table with your list name, PortalHomeDataContext with your site name (without spaces) + DataContext and RestTest.ServiceReference1 with your generated namespace.

This is tested against a SharePoint 2010 site:

http://sp2010/_vti_bin/listdata.svc/Table?$filter=(Color eq 'Red') and (Active eq false)

A very efficient way of getting the syntax (provided you know C# and LINQ) is the following:

  1. Create a Console Application using visual studio
  2. Add a service reference to http://sp2010/_vti_bin/listdata.svc
  3. Change to console application to something like this:

    using System;
    using System.Linq;
    using RestTest.ServiceReference1;
    namespace RestTest
      class Program
        static void Main(string[] args)
          var context = new PortalHomeDataContext(new Uri("http://sp2010/_vti_bin/listdata.svc"));
          context.Credentials = System.Net.CredentialCache.DefaultCredentials;
          var data = from d in context.Table
                     where d.Color == "Red" && d.Active == false
                     select d;
          foreach (var row in data)
  4. Now start Fiddler (download from and run the console app. Fiddler will show the url generated by the console app.

share|improve this answer
Just to tack on a tool I find useful with Chrome is Dev HTTP Client. It hav a very simple interface for composing HTTP requests.… – Robert Kaucher Jun 26 '13 at 19:09
Very cool! C# yes, Linq I am a little less familiar with however it's one of those on the list to learn type things so...thanks! – Justin Jun 28 '13 at 10:36
Also just the general tested URL you provided worked for me which I appreciate, but even more so the examples for finding URL from console! – Justin Jun 28 '13 at 10:38

I tried this using the 2013 api in SharePoint online, but I think the filter syntax should work the same...

You need to specify your boolean field as 1 or zero, like this...'defects')/items?$select=Color,Title,ID&$filter=Color eq 'Red' and Active eq 1&$top=100

Also, make sure you are using internal names, not display names.

share|improve this answer
I used the ODATA Query Builder from the SharePoint Online App Store to construct this. An awesome tool, although it does not seem to support boolean fields (And no, I am not affiliated with it). – Derek Gusoff Jun 26 '13 at 17:54
Thanks...I assume that tool is only available in SP2013 since you mentioned app store? The link you provided worked but so did false from previous answer...I suppose at least in sp2010you can use either? – Justin Jun 28 '13 at 10:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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