People Picker to Populate Contacts List Fields

Jan 12, 2015 at 5:01 PM

I'm trying to do something I thought would be simple enough but perhaps I have been looking in the wrong place?

1) I simply have a contact list in SP WSS with a people picker control.
2) When I enter a username in the people picker and press enter it returns the name (with presence) by default. Standars stuff.
3) Instead of reinventing the wheel and manually looking up all the info on this user, all I wanted was to have the last name, first name, phone number and email fields populated by the user value in the people picker.
4) I've tried a myriad of examples on the web but none poplulate the fields.
5) I use getcurrentuser for other puproses but in this case I'm the only one that would be populating the list so some "John Doe" would never be the "current user" but all the AD info would be contained for "John Doe" in the people picker? No?

Any assistance would be greatly appreciated.

Jan 12, 2015 at 5:08 PM
I guess the question would be why you are creating the list. The User Profile store contains all of the info. Why not just look people up that way. What's the use case?

Jan 12, 2015 at 5:19 PM
Hi Marc, thanks for the very quick response!!

Essentially it is a contacts list of users and their membership in a particular governance group using a checkbox (choice column). Then all the other fields such as first name, last name, email, phone etc.

sure I can lookup all the info and manually enter it but this is 2015, and I cant be bothered using that 1980's method any more.

So by entering a persons name in the peoplepicker, I was trying all morning (don't laugh) to get those other fields populated from the user chosen in the people picker using SPServices.

In answer to your question, I thought the people picker retrieves info from the user store. No? Besides, this is a very very vanilla deployment of WSS, everything is tied down so tight. We're not even provided workflow. SPServices seems to be the only choice to retreive that kind of info client side (no Sharepoint Designer, no Visual Studio).

Jan 12, 2015 at 5:27 PM
I'm more curious what you're going to do with the list once you have it populated. You can query a permission group to find the members, then query the User Profiles to get the info. So what are you going to use the data for?

Jan 12, 2015 at 5:34 PM
It will be used as a tracking resource both for myself and anyone else that may want to see who's in what governance group, nothing extraordinary. Also, we will be removing access to AD within the year so I guess id need to pull the information from whatever user profile db we end up using.

AD Security groups, as they currently stand will not be used. I will need to populate all SharePoint groups with users explicitly instead of calling on AD security groups.

So maybe I should just forget about this for now?
Jan 13, 2015 at 11:25 AM
sympmarc wrote:
I guess the question would be why you are creating the list. The User Profile store contains all of the info. Why not just look people up that way. What's the use case?

Hi Marc,

I'm pretty sure UserProfile service is not available to him, if he is using only WSS.

Jan 13, 2015 at 12:12 PM
Yes John tx. Nothing is available to us here, that's why client side is my only option.

Jan 13, 2015 at 12:42 PM
Ah, good point. Sorry - missed that.

You can query the User Information List. You don't have a lot of the AD info there, though. It's sort of the name, rank, and serial number version. To do this, you can use SPGetCurrentUser, which effectively screen-scrapes the data from userdisp.aspx.

Jan 13, 2015 at 12:59 PM
Thanks. So it doesnt just obtain information from the current logged on user? Remember, I was trying to pull it from the people picker. So I add Joe Blow to the list and I need to pull off his phone, email etc. and this can be done with GetCurrentUser?


Jan 13, 2015 at 1:03 PM
For people other than the current user, you can query the User Information List.

Jan 13, 2015 at 1:09 PM
Carlw, I have found in the past, when querying the User Information list, that unless the person was added specifically to a SharePoint Group for the site, they will not appear in this list, until they first visit the site. I am also not sure, but I think that the list is only accessible/visible by administrators.

Jan 13, 2015 at 1:34 PM
Thanks gentlemen. No you are right, it's not available to me, although, I always found the SPGetCurrentUser works fine but it seems that I wont be able gleen info from the People Picker to populate the email, phone etc. fields automatically?

Actually, if I can see that info on AD I should be able to pull it in and extract from the people picker, no?

Jan 13, 2015 at 1:53 PM
Hi Carlw, I believe unless you are using MOSS, which you then can synch your AD profile imports, to bring in that information, into the User Profiles (again only availble in MOSS) you will only get bare minumum info as Marc stated. You would need a custom web service (LDAP lookup) to connect directly to AD, to retrieve the info you require.

Jan 13, 2015 at 2:05 PM

The User Information list in WSS, includes the following fields: Account (Login Name), Name (Display Name), E-Mail, About Me, Picture, Department, Job Title, and SIP Address.

Jan 13, 2015 at 2:30 PM
Thanks. Yes I only need tombstone info anyways.

Jan 13, 2015 at 5:46 PM
Just a note, I remember having issues querying the UIL. It wasn't b/c of my permissions, it was due to the permissions of the currently logged in user. In order for this to work, the permissions needed to be changed on the UIL list (which I opted not to do).

This was for 2007 when I ran into this, so it could be relevant to you.

Jan 13, 2015 at 6:19 PM
Thanks Matthew.

I dont have access to that on this deployment anyways so that's out of the question for me. Besides, I'm really the only person that would likely be entering info into this list.

Cheers back

Jan 13, 2015 at 6:39 PM

Keep in mind, when in WSS, if an end user goes to 'My Settings', available from the drop down under their 'Welcome .... " link, and edit their information, it updates their information in the UIL. However you can not edit anothers information, except through Central Admin, I believe.

I believe also, when a WSS site is setup, only once, does any information get added in the UIL, with no further sychronization between AD. We often have our end users in WSS, update/edit their own information this way, versus using Central Admin.

Jan 13, 2015 at 6:41 PM


Yes, I seem to remember that (another) limitation. No, I don’t want to edit anything, only pull their data out so I don’t have to go searching in Outlook and copy-paste fields such as email etc.


Jan 13, 2015 at 7:05 PM
Hi Carl,

Marc had posted an artcle on how to query the UIL, specifically mentioning the users needing to be granted at least Read level permission (do not need to be an Administrator) to the UIL, in order for any scripting to work, for an end user. As long as you capture the input in your people picker, ( .currentValue), I am sure you could then add CAML filter to the code he mentions, in order to retrieve what you need, using your own altered complete function to add the returned values to variables, and then to your various input fields. Marc's Article: Query the User Information List with jQuery and Web Services

Jan 13, 2015 at 7:07 PM

Well thanks you very much sir. It’s been a while since I was a server admin and had forgotten about that list.

You sir should take the rest of the day off, with pay of course.