Sharepoint list hide row based on value

How to hide full item row based on group membership of user (or a column value). I have this list view:

Sharepoint list hide row based on value

I want to hide complete item row based on user membership in department groups (SharePoint groups containing users of different departments Legal, Project Mngmt etc). So that each depart employees view their entries only. I do not want to use Target audience on list view webpart.

I have used this code to hide fields in form but how to use it to whole item row in list view?

$(document).ready(function() { $().SPServices({ operation: "GetGroupCollectionFromUser", userLoginName: $().SPServices.SPGetCurrentUser(), async: false, completefunc: function (xData, Status) { var flag = ($(xData.responseXML).find("Group[Name='LegalDepartment']").length == 1); if (!flag) { //To Hide Column Header $("nobr:contains('User ID')").closest('tr').hide(); } } }) })

How is it possible through SP services/javascript?

You can hide and even set a unique permission for each row in a list, also you can control who sees which rows in SharePoint. This functionality is PMO project dashboard, where you can project all your projects and you can hide few rows from the list. You can also limit user access in a list by utilize item-level permissions and improves SharePoint List Row Level Security. But the drawback of this feature is, you cannot set permissions for a specified row for a specified user. Purchase Microsoft SharePoint from Veelead Solutions
There are different methods in hiding the rows, such as modern custom list or classical list like Tasks, Contacts, etc., but the steps might vary between modern custom lists and other lists. You can follow the instructions below.

Hiding rows in a SharePoint Modern Custom List

This method is like, how you set an exclusive access for a document or folder in a document library, but you need to stop security inheritance between row and the list.

1.Move to SharePoint custom list with data
2. Select the checkbox near to an item you want to set exclusive permissions for

Sharepoint list hide row based on value

3. Now select “i” Panel on the right side. Below you will find who currently has access to the item. Select Change permissions

Sharepoint list hide row based on value

4. Now you can click on each user/group and then Stop Sharing for each user or select Stop sharing on top of the panel. You can modify to View only in case you want a specified user to be able to edit an item

Sharepoint list hide row based on value

5. If you want Stop sharing for everyone above, you will see a warning message.

Sharepoint list hide row based on value

6. You can add specific users and even users who do not have access to the site and give them permission to edit or view a single item/row from the whole list

Sharepoint list hide row based on value

7. Once these steps are followed, your list will look different depending on who is logged in.

Sharepoint list hide row based on value

8. and below is the same list with three rows hidden as I am logged in as another user.

Sharepoint list hide row based on value

Hiding rows in classic SharePoint lists

As mentioned in the introduction, while hiding rows in classic lists you should stop the inheritance for rows. One important factor is, classic lists do not have “i” information panel on the right side as it is in modern custom lists.

1. Select the checkbox near the task you want to hide or set exclusive permission. Then click on ellipsis, ellipsis again, then Share

Sharepoint list hide row based on value

2. Select Shared with. This allows you to be notified who the task is shared with.
3. You can also either Stop Sharing to everyone or Select Advanced to set exclusive permissions

Sharepoint list hide row based on value

4. Once Advanced is clicked, a screen pops up. This looks very similar to how you would be setting up security for a website. You can now Stop Inheriting Permissions.

Sharepoint list hide row based on value

5. Add/remove groups/users as necessary

Sharepoint list hide row based on value

Get 24/7 SharePoint Support and Guide from experts. Talk to us for SharePoint Implementation experts today

Can anyone explain this? I wrote this JSON back in June. It's to show birthdays for the current month. I have a simple list with a date field. To hide rows that are not in current month, I am comparing getMonth of the birth date versus @now.

Notice: my txtContent shows the result of the evaluation. When I publish the view - I'm getting no data. (Oddly - this worked in June and July.)

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json", "hideSelection": true, "hideColumnHeader": true, "rowFormatter": { "elmType": "div", "style": { "display": "=if(getMonth([$DateOfBirth])==getMonth(@now)), 'block', 'none')", "white-space": "nowrap", "overflow": "hidden", "margin": "1px 4px 4px 1px" }, "attributes": { "max-width": "150px" }, "children": [ { "elmType": "div", "style": { "text-align": "left", "font-size": "18px", "font-weight": 400, "font-family": "Segoe UI, Arial, Tahoma" }, "children": [ { "elmType": "span", "_comment_": "=getMonth([$DateOfBirth])+'/'+getDate([$DateOfBirth])+' - '+[$Title]+' - '+getMonth(@now)", "txtContent": "=getMonth([$DateOfBirth])==getMonth(@now)" } ] } ] } }

When I preview - I get only TRUE entries (those with matching month values). When I save and refresh - it shows blank.