0

I try to get the value in column "About me" of Sharepoint group. But It always empty. I'm using Sharepoint server 2013, my account is site administrator. Get value from "About me"

My code to get:

 var groups = SPContext.Current.Web.CurrentUser.Groups;
                foreach (SPGroup item in groups)
                {
                    litMessage.Text += item.Name + "#" + item.Description;
                }

And the result: Result

Please help me how to get this value.

Updated: I cannot get about me of new group (GroupPR&CC). The default group (Approvers, Designers...) is ok.

1 Answer 1

0

You can use the below code to get the description:

var groups = SPContext.Current.Web.CurrentUser.Groups;
foreach (SPGroup group in groups)
{
    SPListItem groupItem = web.SiteUserInfoList.GetItemById(group.ID);
    litMessage.Text += group.Name + "#" + groupItem["Notes"];
}

If its a single group, use it as below:

SPGroup g = web.SiteGroups["GroupName"];
SPFieldMultiLineText text = (SPFieldMultiLineText)web.SiteUserInfoList.Fields[SPBuiltInFieldId.Notes];
SPListItem groupItem = web.SiteUserInfoList.GetItemById(g.ID);
var description = groupItem["Notes"]
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.