SharePoint List view depending on user group

Copper Contributor

I have a view is [Me], but the last piece of data can be viewed by more than one person. How can I maintain this view, because more than one person can leave and then others can join,Thank you for your answer

5 Replies

@xiaobai1290 If you are trying to filter the list view based on currently logged in user's group membership, then it is not possible using SharePoint out of the box capabilities.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Is there any way to make a particular piece of data more maintainable? This data is available to a group, but the group's personnel need to change frequently@ganeshsanap 

@xiaobai1290 You can use item level permissions in list and share list items with groups.

 

Group members can only see the list items which are shared with the respective group (in default All items view).


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Thank you very much for your answer, but this still cannot achieve the effect I want. What I want is that for example, in a list, a certain piece of data is designated to a group, and then I add and delete members in the group, the corresponding piece of data corresponds to the permission of this group, and another piece of data is given to another group, and then it has another permission

@xiaobai1290 

 

As per my understanding you want to create view with [Me] filter in user field where SharePoint Group can be there and it should show data if current user is part of that group.

 

If my understanding is correct then from UI, you can't create that view with this filter condition but you can adapt filter condition using PowerShell after creating view.

You can use Membership element in the query. E.g. 

 

<Or>
  <Membership Type=\"CurrentUserGroups\">
    <FieldRef Name=\"AssignedTo\"/>
  </Membership>
  <Eq>
    <FieldRef Name=\"AssignedTo\"></FieldRef>
    <Value Type=\"Integer\">
      <UserID/>
    </Value>
  </Eq>
</Or>

 

 

Instead of AssignedTo field you can use your user field here.

 

Below are some PowerShell script reference using which you can update filter condition of your view:

 

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community