1

I only have access to account IDs. Ex 59206.

No access to user names.

How can I use SPservices to get the rest of the account information?

1

2013

SP.Web.getUserById()

http://msdn.microsoft.com/en-us/library/office/jj247179(v=office.15).aspx

or

spservices

GetUserProfileByGuid and GetUserProfileByIndex should work

http://spservices.codeplex.com/wikipage?title=UserProfileService

and another solution

http://spservices.codeplex.com/discussions/262196

$.ajax({
    url: 'http://info.global.Company.com/demo/OrgChart/Documents/peoplefunc.aspx?ID='+itemId,
    success: function(data) {
    $().SPServices({
        operation: "GetUserProfileByName",
        AccountName: $(data).find('div').text()+'@Company.com',
        completefunc: function (xData, Status) {                
             alert($(xData.responseXML).find("Name:contains('First')").parent().find('Value').text());
        }
    });
  }
});
1
  • The Ajax code piece is great way of getting the info direcly from Organization chart. But what if the Org chart is silverlight based & HTML is not configured for the view? just asking – Anand Mar 21 '14 at 17:40
0

You could query User Information List to retrieve User details.

How to get user information using SharePoint Web Services (SPServices)

function getUserInfo(userId,result)
{

  $().SPServices({
     operation: "GetListItems",
     listName: "User Information List",
     CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" + userId + "</Value></Eq></Where></Query>",
     CAMLRowLimit: 1,
     completefunc: function (xData, Status) {
         var userEntry = {};
         var row = $(xData.responseXML).SPFilterNode("z:row").get(0);
         userEntry.Name = $(row).attr("ows_Name");
         userEntry.Title = $(row).attr("ows_Title");
         userEntry.Email = $(row).attr("ows_Email");
         result(userEntry);
     }
  });
}


//Usage
getUserInfo(12,function(userEntry){
    console.log(JSON.stringify(userEntry));
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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