Contact Selector control is not setup by default on your InfoPath application. This post will assist you in adding and configuring the control (with pictures).
Let us begin by selecting Controls from Design Tasks. Note: If you do not see the Design Tasks pane, then go to View on the toolbar on top and select Design Tasks.
In Controls, go right to the bottom. Click on the Add/Remove Custom Controls… link.
On the Add or Remove Custom Control window, select Add. This will get the Custom Control Wizard up.
At the Select a Control Type screen in the wizard, select ActiveX Control then click on Next.
On the next screen, you’ll see a list of ActiveX Controls listed alphabetically. Select Contact Selector then click on Next.
On the Specify Installation Option screen, select the Don’t include a .cab file option then click on Next.
On the Specify a Binding Property screen, select Value then click on Next.
On the Specify Data Type Options screen, select Field or Group (any data type) option from the pull-down menu then click on Finish.
We now have the Contact Selector control available under the Custom heading, on the Controls pane. We have to configure before use.
From Design Tasks again, select Data Sources. If, you’re still on the Controls view click on the Design Tasks link at the top.
We need to create a structure that will be used by the Contact Selector control. To do this, select the root-level on the Data Source (myFields). Right-click and and from the menu and select Add…
On the Add Field or Group window, type in ContactSelector for name and select Group for Type then click OK.
Now select the group just created from the Data Source pane. Right-click on the group and from the menu and select Add…
On the Add Field or Group window, type in Person for name and select Group for Type. Also ensure that the Repeating option is ticked, then click on OK.
Once again from the Data Source pane, right-click the Person repeating group just created and from the menu select Add…
Type in DisplayName for name, and leave Field (element) for Type and Text (string) for Data type, then click OK.
I performed the above step twice more. Once, use AccountId for name and then use AccountType for the next. Note: Ensure that you’ve type them out exactly, they will not work otherwise.
You should now see a structure (see below) on your Data Source pane.
Before we proceed, open up a text editor such as notepad and type in the XML syntax as shown in the picture (see below). Note: Type in your domain name for the site url (eg: siteUrl=”http://yourdomain”)
Save the file as Context.xml
We now need to add the Context.xml file created the previous steps as a data connection. Click on Tools from the toolbar on top and select Data Connections…
On the first window, click on Add… This will start a Data Connection Wizard.
On the first screen, select Create a new connection to: and then Receive data. And then click on Next.
On the Select the source of the data screen, ensure that XML document is selected then click on Next.
On the XML data file details screen, click on the Resource Files… button.
On the Resource Files window, click on Add…, then navigate to where the Context.xml is saved. Select the file and click on OK, and then click on OK again on the Resource Files window.
Click on Next to proceed.
On the Enter a name for this data connection: screen I just left the default name that appear, which would be Context. Click on finish.
So now, we’ve added and configured the Contact Selector control. Time to test if it indeed works. Select the ContactSelector group for the Data Source pane and drag it unto the form.
Click on Preview from the toolbar on top, and you’ll see the control. Type in a login name, and click on the tick to validate the user.
If everything has been done right, the user will be validated.
We have now successfully ventured into getting Contact Selector up and running. Happy SharePointing!