0

Hello i have a SharePoint list that has a Person or Group column that stores a user. I am trying to Filter the view of the list using the [Me] column value. Currently it is filtering for a single user..However my requirement is to filter for a share-point user group. In other words anyone who exists in the share-point user group will be able to see the list item.

i have attempted to simply replace the user with the user group..but it would not filter as expected.

Edit: i am using SharePoint 2016 on-premise

1

Out of the box, you can only add a filter on "[Me]" - so if the current user is the member of any group, then the [Me] keyword filter won't work. however, if you want to apply the filter on the SharePoint group you need to open the view in SharePoint designer and do the necessary changes.

Try following these steps:

  1. Create a new view, and open the corresponding Aspx in Sharepoint Designer
  2. In the source code, locate the ListViewXml tag
  3. Inside this tag, locate the Where clause (begins with "")
  4. Add the below tage (detail tags are avaialble in the below links):

    Membership Type="CurrentUserGroups" FieldRef Name="AssignedTo"

  5. Save the page, and you're ready to go.

For details steps, you may refer to the below article:

Filter list views by user groups

Filtering a View by Group Membership

4
  • thanks for this, i have created a view "Test.Aspx" when i navigate into its code i cannot find a ListViewXML tag or a Where clause...i am using sharepoint 2016 on premise – Jilo Apr 1 '20 at 17:51
  • Ohh is it... please refer the second link, it sounds promising, they have given some screenshots. – GSD - SharePoint Apr 1 '20 at 18:05
  • My Bad your solution in the second post has worked. i have not clearly followed the instructions i will mark this as answer. I just want to point out in SP 2016 ListViewXml tag is not generated. However the where clause will appear only after you make a filter condition [Me] as mentioned in the second link. Thanks!! – Jilo Apr 1 '20 at 18:47
  • 1
    Wow, I am glad to hear that it worked :-) – GSD - SharePoint Apr 1 '20 at 18:55

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.