Friday, September 6, 2013

Filter Sharepoint View Using Query String

Default we only filter on column (equal =) then return parameter on url, below is all items of Tasks list
Now we can filter (like query) data Equal than with structure: FilterField1=ID&FilterValue1=1&FilterOp1=Eq
FilterField1=ID&FilterValue1=1&FilterOp1=Neq
FilterField1=ID&FilterValue1=2&FilterOp1=Gt
FilterField1=ID&FilterValue1=2&FilterOp1=Geq
FilterField1=ID&FilterValue1=3&FilterOp1=Lt
FilterField1=ID&FilterValue1=3&FilterOp1=Leq
FilterField1=Body&FilterValue1=a&FilterOp1=BeginsWith
FilterField1=Body&FilterValue1=b&FilterOp1=Contains

You can use many condition (and) like:
FilterField1=ID&FilterValue1=1&FilterOp1=Gt&FilterField2=Status&FilterValue2=i&FilterOp2=Contains

3 comments:

  1. Thanks for the indepth information. I haven't been able to get this to work, after pasting and when clicked on 'Test Query' I get an error 'We didn't understand your search terms. Make sure you're using the proper syntax.' ? Do you know if anything has changed that is causing this to break?

    ReplyDelete
  2. https://social.technet.microsoft.com/Forums/office/en-US/1b067714-5c0d-4b07-8b34-a379bcfd1837/filterop1-sharepoint-list-inplview?forum=sharepointgeneral#1b067714-5c0d-4b07-8b34-a379bcfd1837
    It does not work to do column filters after your search.

    ReplyDelete
  3. Hi,

    Did you try to filter with ID or Title column?

    Thanks,
    Hung

    ReplyDelete