SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write an application page that will list the pending workflow tasks for the logged-in user. Is there an object in the SharePoint model I can query to give me a list of the pending tasks for the current user?

share|improve this question
In the context of the current site, entire farm, or enterprise-wide? – Rob D'Oria Aug 14 '11 at 21:51
In the current site. – Clay Acord Aug 14 '11 at 22:33

There really isn't an API per se...the tasks are recorded in site-specific Task lists. There is an OOB web part (User Tasks under the Social Collaboration category) that shows the tasks for the current user, but if you want to go beyond that you can reference one possible solution in the following post from Waldek:

I know I saw a blog post once on using Linq to query across sites and site collections to get a consolidated task list, but am not able to find it after a quick search.

share|improve this answer

I had a simailar issue and found this tutorial to be helpful...

Shows how to query lists using linq. I just changed the where clause to to be

userid = web.AllUsers["username"].ID;
var q = from task in Tasks
        where task.AssignedToId == userid
        select task;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.