Filtering SharePoint List View using CAML

 

SharePoint_2010_Logo

This post will illustrate how you can apply filters on SharePoint list views using CAML. There are many ways you can apply filter on any list view. CAML gives you more control to apply complex filters over a list view. For example you may have a case to filter Tasks based on “Assigned To” field(“Assigned To” may contain any user or any SharePoint group) and you only want user or group from this field may able to see that particular list item. To achieve such kind of filter the only way is you use CAML.

 

To apply filter on list view using CAML query follow steps below.

Step 1

Open your site in SharePoint Designer and Select the list under “Lists and Libraries”. In our case its “Workflow Tasks”

12

 

Step 2

Select the view under “Views” on which you wants to apply filter. You can either select existing views or create a new one.

3

 

Step 3

Once the .aspx file is opened search for “Query” tag. Under this tag you can place you CAML to apply the filter.

3.5

 

step 4

Once you apply the CAML click on save icon 4 and refresh the page where this view is being used. You can now see filtered results based on your query.

 

Hope you find this post helpful. Do comment in case you have any concerns below.

No comments:

Post a Comment