none
SharePoint REST Query - How to say "Where <field> Is Null or Empty" RRS feed

  • Question

  • SharePoint REST Query

    This is the returned value for the field I want to use

    <d:myfield:null="true" />

    <REST>...?$filter=myfield_____________? (how do I say is (not) null or empty)

    Thanks in advance!

    Wednesday, July 3, 2013 5:49 PM

Answers

All replies

  • Hi,

      try <REST>...?$filter=myfield ne null

    Please refer the below link for your reference,

    http://msdn.microsoft.com/en-us/library/gg309461.aspx#BKMK_filter


    Balaji -Please click mark as answer if my reply solves your problem.

    Wednesday, July 3, 2013 6:10 PM
  • Don't know why this was marked as answered. It doesn't work. The reference given is for MS Dynamics CRM. It appears SharePoint's REST does not implement null.

    I got the filter to return all non-blank values with $filter=myfield gt ''.

    • Proposed as answer by avi6890 Tuesday, June 9, 2015 5:26 PM
    Monday, September 22, 2014 8:53 PM
  • Hi,

    The current implementation of REST does not support null values for filtering on list item queries.  but it is being worked on, as it is very common case, Hopefully there will be a solution soon.

    Monday, September 22, 2014 10:06 PM
  • $filter=myfield ne null  - Appears to work now, but I did confirm that the value being returned was 'null' when the field was empty, using Chrome's Advanced Rest Client extension. 

    Friday, July 17, 2015 8:11 PM
  • As PaulE mentioned above, the current implementation of the SharePoint OData interface does not support null value filters. However, filtering as he suggested ($filter gt '') does not work either for me.

    You can try submit a CAML query via REST by POSTing it to the server as a workaround, see this post.

    

    
    Tuesday, January 9, 2018 10:40 AM