Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I use these lines of code:

<SharePoint:ClientPeoplePicker ID="clpUser" runat="server" UseLocalSuggestionCache="True"/>

JS:

var peoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[clientId + "_TopSpan"];
var users = peoplePicker.GetAllUserInfo();

var expressions = new Array();
for (var i = 0; i < users.length; i++) {
    expressions.push("<Eq><FieldRef Name='Absentee'></FieldRef><Value Type='User'>" + users[i].DisplayText + "</Value></Eq>");
}

var query = buidQueryFromExpressions(expressions);

My problem is for several users ClientPeoplePicker returns values that represent login (domain/username), but for the CAML query I should use display name or ID, because in my list that stores the data the user display name is used. How can I correctly configure this control? May be you know other solutions?

share|improve this question
    
Looks like you found an answer: sharepoint.stackexchange.com/questions/58866/… –  Jussi Palo Feb 18 '13 at 14:48
    
@JussiPalo, I'm thinking about my solution as workaround. I don't like it. I would like to find better solution :) –  Alexander Feb 19 '13 at 7:50
    
Using that hidden User Information List to get the ID has been a workaround since SP 2007 so I'm guessing it is now a solution :) –  Jussi Palo Feb 19 '13 at 13:53
    
@JussiPalo, plz put your comment as an answer, I will select it as correct. –  Alexander Sep 20 '13 at 14:17
add comment

1 Answer 1

up vote 1 down vote accepted

Using the hidden User Information List to get the ID has been a workaround since SP 2007 so it's basically a solution for this.

share|improve this answer
add comment

Your Answer

 
discard

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.