I am trying to use the operation "GetGroupCollectionFromUser" in SPServices but I'm having problems getting the description (About Me) of a SharePoint group.  I notice that the description (About Me)  shows for the default sharepoint groups created for a site but not when I add it.  It always shows empty when I bring the data back but in the UI, there's data.
See image below.

My goal is to determine what SharePoint Group a user belongs to and permission that page accordingly.


Below is my code and the page I have it running on.

<script type="text/javascript" src="" language="javascript"></script>
<script type="text/javascript" src="" language="javascript"></script>

<script type="text/javascript">
	  operation: "GetGroupCollectionFromUser",  
	        userLoginName: $().SPServices.SPGetCurrentUser(),  
	        async: false,
	        webURL: "/",
	        completefunc: function(xData, Status) 


Open in new window

Thanks for any help you can provide.
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
Neil RussellConnect With a Mentor Technical Development LeadCommented:
Using the description is totally the wrong way to go about this.  The group names are all you should be interested in.  Realistically you should be using AD groups and not sharepoint groups and then you can have Groups within Groups.
You can then have an overall IsFinance group that you add all of the individual financeA..E groups into and you only need then to check for the user being in the one single Group, IsFinance.

Forget about descriptions.  Descriptions are not there for security trimming, are not uniform, can contain XML and formatting, are not guaranteed to NOT CHANGE.
Neil RussellTechnical Development LeadCommented:
You have everything you need then  Description is not needed to know what you are doing with a group in CODE.
Description is not held in the same place for user created groups.
there is an article on Stackoverflow that explains it with code here but in short, the description of user created groups is stored in the SiteUserInformationList Builtinfields array

Example in c#
SPGroup g = web.SiteGroups["GroupName"];
SPFieldMultiLineText text = (SPFieldMultiLineText)web.SiteUserInfoList.Fields[SPBuiltInFieldId.Notes];
SPListItem groupItem = web.SiteUserInfoList.GetItemById(g.ID);
groupItem[text.InternalName]= groupDescription;

Open in new window

IsaacSharePoint Client Side DeveloperAuthor Commented:
Do you have any examples using  spservices & javascript?
Neil RussellTechnical Development LeadCommented:
No but why do you need the DESCRIPTION to do security trimming?  You have the NAME of the groups and thats what you should be working with.  You said "My goal is to determine what SharePoint Group a user belongs to and permission that page accordingly."  for that you don't need any descriptions. And dont forget descriptions can change anytime but have NO Effect on security or group permissions or membership.  Description is just an arbitrary string of chars that has no meaning except what you make of it.
IsaacSharePoint Client Side DeveloperAuthor Commented:
There are many groups and there are only 5 groups I need to check from:


The only way to know if I the user is in one of the groups above is to have the name "Finance" in the description and I don't want to hard code the names above in the code because they could be new ones or they could be changed.  I also tried creating a new column and add "Finance" to that but the data for that does not show.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.