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

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'
  • 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 '17 at 6:05
  • You would replace 'Workflow Tasks' with the List you want to use. – Omar Stewey Aug 4 '17 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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