In this post we will discuss how to auto populate infopath 2010 people picker control in SharePoint 2010. Also you can check out my previous posts on:
Here we will see how user name will be auto populated in people picker control in infopath 2010. Also we will see how to auto populate manager name in people picker control in infopath 2010.
First create data connection
Data -> Dataconnection -> Add -> Next -> SOAP web Service -> Type Address as http://<Your Site>/_vti_bin/UserProfileService.asmx
-> NEXT (Also you can check this article
on how to create data connection in infopath 2010)
Choose GetUserProfileByName -> Next -> Next -> Next -> name the data connection-Finish
1. Go to main data connection.
2. Select the desired people picker
3. Expand the people picker group -> dispalyname -> rightclick -> value -> fx -> Insert field or group -> chose GetUserProfileByName from data connection -> expand datafield -> values as shown in the fig below.
Then from Filter Data -> Add -> Select field or group from dropdownlist -> name -> is equal to -> type text "PreferredName" -> ok -> ok -> ok
4. PreferredName is case sensitive. So write as shown in the fig below:
5. Click Ok for all dailog boxes.
Similarly to auto populate manager name you have to choose only GetCommonManager when creating data connection in the place of GetUserProfileByname and rest all steps are same as above.
After that publish the form.