Follow the steps very carefully below. It takes a lot of steps to get the contact selector working in InfoPath but once you get it working you shouldn’t have any problems doing it again. Note that the example below assumes you are using InfoPath 2007 and that you have access to a SharePoint server.
Create a new form in design mode
Open the task pane by pressing Ctrl-F1 or View >> Task Pane
Select Controls in the Design Tasks window
If you do not see the contact selector under Custom you will need to add the ActiveX control for the first use. Scroll to the bottom and select Add Remove Custom Controls.
Select Add or Remove Custom Controls… and the custom controls window will appear. Select Add.
Choose ActiveX Control
Do not include the cab file
Select Value in the bind to property
Select Field or Group in the Specify Data Type Options screen
Now that you’ve successfully added the contact selector to your available Infopath controls let’s go ahead and add the control to our form
Double click on the newly added control to view its properties. Select the Items tab. This displays the schema that the contact selector expects, it’s case sensitive so take care (consider taking a screenshot). If you read this tab carefully it tells you everything you’ll need to do in order to get the contact selector working.
Unfortunately, InfoPath doesn’t create this schema for us so we will need to add it to our data source by hand. In the tasks pane select Design Tasks then select Data Source .
In the Data Source window right mouse key on the contact selector’s group and add the Person group as a repeating group.
AccountId (note the “d” is lowercase)
The resulting structure should look like this. You can rename group1 and then promote it to a person column in SharePoint
Now you will need to configure a secondary data source for the server context. You will first need to create an XML file called Context.xml as required by the contact selector.
Save the file as “Context.xml”
Within InfoPath select Tools >> Data Connections
Add a new data connection to receive data
Select XML document
In the XML data file details window select Resource Files and add the Context.xml document you previously created.
Leave the name as Context
Complete the Wizard
Preview the form
If you received a “Search Failed” message don’t worry, this is normal. You most likely have a typo in the Context.xml or you made a small mistake creating the data source.
Remember that the data source for Context is receive.
Make sure the Context.xml is well formed (the context tag must have an end tag)
Make sure the data source is named Context
Make sure you spelled all of the field names correctly
Make sure that the person field is repeating
Validate the binding of the contact selector control, it should bind to the parent of the Person group
Rating: 8.9/10 (46 votes cast)
Rating: +19 (from 21 votes)
Adding a Contact Selector/People Picker to an InfoPath Form, 8.9 out of 10 based on 46 ratings
Ulysses Ludwig is a SharePoint architect with over 16 years in the IT and computer industry. Ulysses' primary focus is SharePoint but he dabbles in the latest web technologies and likes to develop software in his spare time.
62 Comments for Adding a Contact Selector/People Picker to an InfoPath Form