SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using the below SPServices call, I can get the display name of the author of a list item:

                operation: "GetListItems",
                async: false,
                listName: "MyList",
                CAMLViewFields: "<ViewFields Properties='True' />",
                CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Integer'>" + id + "</Value></Eq></Where></Query>", 
                completefunc: function (xData, Status) {
                    $(xData.responseXML).find("[nodeName='z:row']").each(function() {
                        author = $(this).attr("ows_Author");

This gets me a name like "43#;John Doe". How can I get the account name instead? Like "john.doe". So I can use it to get the user's manager's account name.


share|improve this question
up vote 3 down vote accepted

You need to use the Users and Groups web service. If you call the GetUserCollectionFromWeb() method, it will return an XML node containing all the users on the site. You can then look up your specific user using the ID returned in your User node - in the case of the example - 43.

The web service will return a collection of User nodes which have an ID attribute one of which will match your ID, and a LoginName attribute which will be the information you are after.

The SPService reference to the service is here

The MSDN reference to the service is here

share|improve this answer

I've read that if you include:


in your CAMLQuery, it will bring back the account name in addition to the display name.

However, it is not working in WSS for me, and I vaguely recall it might only work in MOSS.

share|improve this answer

I've done this same thing in C#, using the format style of the username you provided, and used the class SPFieldUserValue to get the actual user object, seen below:

string user = new SPFieldUserValue(web, "43#;John Doe").User.Name;

I'm not familiar enough with the client object model to provide an example for you, but take a look here. See if either of the two solutions provided help you. They are using the FieldUserValue class, the client object model implementation of the SPFieldUserClass.

share|improve this answer
+1. Thanks a lot Tim, spot on. – JᴀʏMᴇᴇ Sep 26 '12 at 14:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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