SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

I've got a problem with not being able to select a single list item from the User Information List, I have used U2U CAMLbuilder to build a query that extracts an entry with the ID = 1 When run in the CAMLbuilder the query returns a single valid item. But when the query is executed in javascript client object model code it returns: "all available users". This is unacceptable performance-wise.

The query itself seems to be correct, as I've said I've verified it in CAMLbuilder and also had it reviewed by a colleague. So I'm wondering if there might be any known issues with selecting items from the User Information List.

share|improve this question

You should be able to just use:

SPList list = SPContext.Current.Web.SiteUserInfoList;
SPListItem item = list.GetItemById(SPContext.Current.Web.CurrentUser.ID);
share|improve this answer

I think your query must be correct but you might be calling it in a wrong way. See my answer here for the correct form of using the caml query with the client object model.

no sorting with JavaScript Client Object Model?

Also, if you have to get only 1 user by ID, then you won't require the CAML query. You can use the code Jasper has provided. Only thing is that code is from the .NET managed client object model. The code in the javascript client object model will be similar to this:

var clientContext = new SP.ClientContext.get_current();

var web = clientContext.get_web();

var userInfoList = web.get_siteUserInfoList();

this.itemUser = userInfoList.getItemById(1);


clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),Function.createDelegate(this, this.onQueryFailed));

function onQuerySucceeded(sender, args)
function onQueryFailed(sender, args)
share|improve this answer

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.