1

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?

4
  • Looks like you found an answer: sharepoint.stackexchange.com/questions/58866/…
    – Jussi Palo
    Commented Feb 18, 2013 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
    Commented Feb 19, 2013 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
    Commented Feb 19, 2013 at 13:53
  • @JussiPalo, plz put your comment as an answer, I will select it as correct.
    – Alexander
    Commented Sep 20, 2013 at 14:17

1 Answer 1

1

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.

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.