Retrieve Tasks assigned to a user or current user groups in SharePoint using CAML query

This CAML SharePoint tutorial explains how to retrieve tasks assigned to a user or current user groups in SharePoint using CAML query.

Follow the below steps:

Open your site in SharePoint designer 2010. Go to List and Libraries option. Select your Task List to see in fig.

Retrieve Task assigned to a user or current user groups in SharePoint using CAML query

Open the task list in advance mode or .aspx extension file. Find the view tag under this <Query> option. Change by the following code only under the <Query> tag

<View Name=……
<Query>
<Where>
<Or>
<Membership Type="CurrentUserGroups">
<FieldRef Name="AssignedTo" />
</Membership>
<Eq>
<FieldRef Name="AssignedTo" />
<Value Type="Integer">
<UserID Type="Integer"/>
</Value>
</Eq>
</Or>
</Where>
</Query>

Save and check out the page.

You may like following SharePoint CAML tutorials:

This is how we can retrieve task assigned to a user or current user groups in SharePoint using CAML query in SharePoint 2010. The same CAML query we can use in SharePoint 2013/2016 or SharePoint Online also.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Navneet Singh

I am Navneet Singh, Working at C3it software solutions pvt. ltd. in Pune. My core skills are SharePoint 2013, Office 365, SharePoint 2010, SharePoint Designer, SharePoint Designer Workflow, Nintex Workflow, Infopath, Webpart, CSOM/SSOM, Power-shell, C#, ASP.NET and SQL Server.

>