Introduction
This article explains how to apply filters in a query string URL in SharePoint 2013 for a multi-choice field.
Prerequisites
Ensure you have a SharePoint site.
Scenario
Dynamically add list items in quick launch and apply filters.
Use the following procedure.
- Create a custom list called called Test.
- Add a field called “Skills” and type to be “Multi choice filed”.
- Now add the data to the list.
- Now comes the filter criteria.
Format Yousiteurl/Lists/listname/ViewName.aspx? FilterField1=FieldName& FilterValue1=ValueToBeShown&FilterOp1=Contains
Example
http://YourSiteURL/Lists/Test/AllItems.aspx?FilterField1=Skills&FilterValue1=C%23&FilterOp1=Contains
&FilterOp1=Contains is important and the URL string is case sensitive
- Default we only filter on column (equal =).
- Now we can filter (like query) data Equal than with structure: FilterField1=ID&FilterValue1=1&FilterOp1=Eq
- Likewise you can replace Contains with Eq, Geq, Neq, Lt and so on.
- That's it. Now let's test the list by adding the preceding URL.
Testing
- Now let's filter the Skills by C#.
- Append the URL in the browser:
http://YourSiteURL/Lists/Test/AllItems.aspx?FilterField1=Skills&FilterValue1=C%23&FilterOp1=Contains
That's it.
Summary
Thus in this article you saw how to apply filters in a query string URL in SharePoint 2013 for a multi-choice field.