1

In SP list we have to show tasks of all users from one department plus users which doesn't have any tasks.
Any idea how can I get names of users from one department?

I read a question and answer here, but solution is not so good for us as it looks onto User information list, and I need all users from department whether they logged in or not into that site collection.

2 Answers 2

2

You can use the REST API to expand the 'AssignedTo' column and filter based on the Department of choice. Here's an example of that query:

https://sharepointurl.com/_api/web/lists/getbytitle('Workflow Tasks')/Items?$expand=AssignedTo&$select=ID,Title,DueDate,AssignedTo/Department&$filter=AssignedTo/Department eq 'Marketing'
2
  • Not sure how could do it. Don't want to brag but, example of yours would get only users that started workflow?
    – Danilo
    Aug 4, 2017 at 6:05
  • You would replace 'Workflow Tasks' with the List you want to use. Aug 4, 2017 at 20:19
0

Rather than using a list to display those users and their tasks you might consider using a search page, as that will give you a lot of ways to tweak your search queries and display templates

2
  • well, I can't say that to my superior :) But thank you for your time.
    – Danilo
    Aug 4, 2017 at 6:00
  • 1
    Why not, search is the king of Sharepoint from SP 2013 onwards, and I guess it is common knowledge :-) Aug 4, 2017 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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