Forum Discussion
SharePoint List view depending on user group
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 frequentlyganeshsanap
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
- xiaobai1290Mar 28, 2023Copper ContributorThank 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
- kalpeshvaghelaMar 28, 2023Iron Contributor
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:
- https://www.sharepointdiary.com/2018/04/sharepoint-online-powershell-to-update-list-view.html
- https://www.codesharepoint.com/powershell/set-view-query-in-sharepoint-using-powershell
Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community