OData filter with logical or operator

3 posts, 1 answers
  1. Gary
    Gary avatar
    18 posts
    Member since:
    Jun 2012

    Posted 18 Jun 2012 Link to this post

    I have been unable to find in the documentation how to add multiple filters with logical or instead of and.  Here is my code which results in a query like this:

    filter=(SubscriptionId+eq+0+and+SubscriptionId+eq+472) 

    what I want is this:

    filter=(SubscriptionId+eq+0+or+SubscriptionId+eq+472) 

    Is there any way to do this?

    $("#ambulation2").kendoDropDownList({
                dataTextField: "Ambulation",
                dataValueField: "AmbulationId",
                dataSource: {
                    type: "odata",
                    serverFiltering: true,
                    transport: {
                        read: "/yglservice.svc/RefAmbulations",
                        dataType: 'jsonp',
                        cache: true                   
                    },
                    filter: [{
                            field: "SubscriptionId",
                            operator: "eq",
                            value: 0
                    },{
                        field: "SubscriptionId",
                        operator: "eq",
                        value: @UserInfo.SubscriptionId.ToString()
                    }]
                }
            });
  2. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 18 Jun 2012 Link to this post

    Hello Gary,

    Here is how you can achieve this:
    http://jsfiddle.net/rusev/RsYcQ/

    All the best,
    Nikolay Rusev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Gary
    Gary avatar
    18 posts
    Member since:
    Jun 2012

    Posted 18 Jun 2012 Link to this post

    Thanks for the fast reply!  That works perfectly.
Back to Top