Hi, this is Frank Mueller again and this is the second of two posts that I’ve written about the InfoPath 2010 Person / Group picker control. InfoPath 2007 form templates containing the Person/Group Picker control (formerly named Contact Selector) will continue to work in InfoPath 2010 the same way they used to as long as the form template remains in the InfoPath 2007 Form Template format. However, if you wish to upgrade your form template to InfoPath 2010 to take advantage of newly added functionality for the control (see this blog post for more details) or other exciting new features, you will have to perform the steps outlined in this post in order to use the Person/Group Picker.
If you follow the steps outlined in this blog post to change your form template, you are changing the data schema of the form template. This means you will not be able to view any previously filled out forms with the new form template. In order to avoid data loss, you should create a new InfoPath 2010 version of your form template and publish it to a different location. This way you can continue to view previously filled out forms with the InfoPath 2007 version of your form template.
Saving the form template in InfoPath 2010 form template format
- Click the File button and select Save As
- In the Save As dialog select the corresponding InfoPath 2010 Web Browser or Filler Form Template in the Save as type dropdown.
- Change the file name to be something different so that you don’t overwrite your existing form template
- Click Save
Removing existing versions of the control from the form
After the form template is saved in the new format, you will notice that each Person/Group Picker in your view will show the following error message when you hover your mouse cursor over it.
Also the Design Checker task pane appears, indicating that the version of the Person/Group Pickers in the view is not compatible with InfoPath 2010. For each Person/Group Picker in all views, do the following:
- Select the Person/Group Picker control in the view
- Notice that the XML node tree that the control is bound to will be highlighted in the Fields task pane (if the Fields task pane is not visible, click Show Fields on the Data tab in the Ribbon).
- Delete the highlighted XML node tree by deleting the root node in the Fields task pane (Right-click the node, and select Delete from the context menu)
- Select the Person/Group Picker control in the view and delete it
- Use the Controls Gallery on the Home tab to insert a new Person/Group Picker at the position in the view where you just deleted the control
- Right-click the newly inserted control in the view and select Person/Group Picker Properties from the context menu
- In the Person/Group Picker Properties dialog select the SharePoint Server tab
- Type in the URL of the SharePoint site (If you don’t know the SharePoint site that the control used to connect to, please follow the optional steps at the end of this blog post.)
- Click OK to close the dialog
Testing the Person / Group Picker
Preview the form in InfoPath Designer or publish the form to a SharePoint site (be sure to publish to a different location in order to be able to view previously filled out forms) and view the form, enter a name or logon alias, click the “Check Names” button and resolve the name! Alternatively you can click the “Address book” button to perform a search if you do not know the complete name of the user.
Configuring advanced SharePoint list control properties (optional)
To configure advanced control properties that are new in InfoPath 2010, such as limiting the entities the control can pick, as well as requiring the control to contain data before the form can be submitted, follow the steps in this blog post.
Determining the SharePoint site URL (optional)
If you added the control to your InfoPath 2007 form template following the steps outlined in this blog post, you will have created a data connection called Context, which specifies the SharePoint site the Person/Group Picker should connect to. Follow these steps to recover the data connection XML file and obtain the URL of SharePoint site:
- Start InfoPath Designer 2010 and open your InfoPath 2007 form template
- Click the Data tab and select Resource Files
- In the Resource Files dialog select Context and click on the Export button to save the data connection XML to a location on your hard drive.
- Open the XML file in a text editor (e.g., notepad)
- Write down the siteUrl to configure the Person/Group Pickers