Show or hide column based on membership to SharePoint Group

I used SPServices library to hide or show list column to current user based on membership to the group.

Here are the steps:

  1. Create a permission group with desired users  in my case ‘Manager’
  2. Add sp services cdn or provide local reference and used below function.
  3. Replace the Group Name and Column to match your list.
$(document).ready(function() {
        operation: "GetGroupCollectionFromUser",
        userLoginName: $().SPServices.SPGetCurrentUser(),
        async: false,
        completefunc: function(xData, Status) {
            // name of group

            if ($(xData.responseXML).find("Group[Name='Risk Manager']").length == 1) {
                //show column if user present in that group

            } else {

                //hide column if user NOT present in that group

Leave comments if you have any questions.

Leave a Reply

Your email address will not be published. Required fields are marked *