We can filter a list using query parameters and the result will be displayed in list view, So we need a SharePoint list view for the same.
Below are the parameters we can use for filtering.
1. Create any list view you want or use a default one, for example:
http://sharepoint/Lists/MyList/AllItems.aspx
2. Call your view with the following parameters; if you already have parameters, then just add the new ones to the query string:
http://sharepoint/Lists/MyList/AllItems.aspx?FilterField1=Title&FilterValue1=ExactTitle
If here, FilterField1 value is the internally recognizable field name, not a display name or friendly name.
The FilterValue1 is the exact value to filter by, not “contains” or “begins with“, this one is assumed to be “equals“.
In this example you will receive all items, titles of which are equal to ExactTitle
So what if you want to filter by multiple values?
Here is how you do that:
http://sharepoint/Lists/MyList/AllItems.aspx?FilterName=Title&FilterMultiValue=ExactTitle1;ExactTitle2
In this example you will receive all items titles of which are equal to ExactTitle1 OR ExactTitle2
Contains:
http://YourSiteURL/Lists/Test/AllItems.aspx?FilterField1=Skills&FilterValue1=C%23&FilterOp1=Contains
Below are the parameters we can use for filtering.
1. Create any list view you want or use a default one, for example:
http://sharepoint/Lists/MyList/AllItems.aspx
2. Call your view with the following parameters; if you already have parameters, then just add the new ones to the query string:
http://sharepoint/Lists/MyList/AllItems.aspx?FilterField1=Title&FilterValue1=ExactTitle
If here, FilterField1 value is the internally recognizable field name, not a display name or friendly name.
The FilterValue1 is the exact value to filter by, not “contains” or “begins with“, this one is assumed to be “equals“.
In this example you will receive all items, titles of which are equal to ExactTitle
So what if you want to filter by multiple values?
Here is how you do that:
http://sharepoint/Lists/MyList/AllItems.aspx?FilterName=Title&FilterMultiValue=ExactTitle1;ExactTitle2
In this example you will receive all items titles of which are equal to ExactTitle1 OR ExactTitle2
Contains:
http://YourSiteURL/Lists/Test/AllItems.aspx?FilterField1=Skills&FilterValue1=C%23&FilterOp1=Contains
No comments:
Post a Comment