0

Is it possible to access the "Name" value in a SP members group using REST? I'm able to reach LoginName, Id, Email, but not Name. My ultimate goal is to pull out all users from a group with specific text in their "Name" field. Thought I could use REST to filter this but it doesn't look like the "Name" value is exposed in anyway. I have two classes of users appearing differently in "Name" field: John Doe User1 and Jane Doe User2. I'm only trying to pull the User1 Name values that are displayed. Is this possible via REST?

Here is the link I'm currently using: 'mysite/_api/Web/sitegroups(12)/users?$select=LoginName'

1 Answer 1

0

Use this:

/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='FirstName,LastName')?@v='accountName'

Then you will have a FirstName and LastName property

4
  • Thanks Mike, I have tried something similar. The only issue with it is that I need to retrieve ALL users for a particular group. The above you provided does it on single user
    – JackSki
    Jun 16, 2016 at 15:02
  • To expand on that. I'm trying to pull all user "Name" values from group 12
    – JackSki
    Jun 16, 2016 at 15:02
  • The profile properties are a per user basis, I think you'd need to pull each user and for each user in a group from REST API using the loginname, have a separate REST API call to get the Name. Also, the "Title" is what I think you could use here instead: msdn.microsoft.com/en-us/library/office/…
    – Mike
    Jun 16, 2016 at 15:35
  • try 'mysite/_api/Web/sitegroups(12)/users?$select=Title'
    – Mike
    Jun 16, 2016 at 15:44

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.