Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

Person / Group Picker Improvements in InfoPath 2010

Person / Group Picker Improvements in InfoPath 2010

Rate This
  • Comments 51

Hi, this is Frank Mueller, a developer on the InfoPath team. In this post which is the first of two blog posts about the Person / Group picker, I want to tell you about the improvements we’ve made to this control in InfoPath 2010.

The Person / Group Picker (aka contact selector) control allows you to type or select users and groups from a SharePoint site, and validate those users against a directory provider. In InfoPath 2010, the Person / Group Picker control is now a 1st class citizen and is available out of the box in the controls gallery! With the new and improved person / group picker, we have eliminated the detailed steps required to insert and configure this control in your forms (the blog post outlining these steps has been one of our most viewed posts). In addition to making the control available in the controls gallery out of the box, we have added new features to improve its integration into SharePoint scenarios.

For information on how to upgrade InfoPath 2007 forms with Person/Group Picker controls to InfoPath 2010, click here.

Adding the Person/Group Picker to your form

From the Controls Gallery on the Home tab or the Controls task pane, click the Person/Group Picker to insert it into the view.

Controls Gallery

Specifying a SharePoint site to query for people and groups

The Person/Group Picker needs to connect to a SharePoint site to be able to function. Specify the SharePoint site as follows, unless you have already published the form to a SharePoint site, in which case that site will be used.

  1. Right-click the control in the view and select Person/Group Picker Properties from the context menu
  2. In the Person/Group Picker Properties dialog, select the SharePoint Server tab
  3. Type the URL of the SharePoint site you want to query

    Control Properties

  4. Click OK to close the dialog

Specifying data validation (optional)

In InfoPath 2010 it is now possible to mark the field the people picker is bound to as Cannot be blank. This means that users will not be able to submit a form without having entered at least one valid person or group in the control. You can mark a field as required by doing the following:

  1. Select the control in the view
  2. In the Properties tab in the Modify chunk, click the Cannot be blank checkbox

 

PPickerCBB

Testing the control

Preview the form in InfoPath Designer or publish the form to a SharePoint site 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.

For information on how to upgrade InfoPath 2007 forms with Person/Group Picker controls to InfoPath 2010, check out my other post here.

Frank Mueller

InfoPath Developer

Leave a Comment
  • Please add 7 and 8 and type the answer here:
  • Post
  • When i try to use property promotion on the people picker control, the recieving column is blank. also if i set the default value of a text field to equal the displayname field of the peoplepicker control, this only works in infopath filler, the form is set to be browser enabled but when i try to view it through the browser after publishing to sharepoint, the value does not change when the peoplepicker is updated.

    I tried using a rule on a button to populate a text field with the value of the peoplepicker control, this has the same result. i.e. works in infopath filler but not when published to sharepoint and viewed through the browser.

    Is this expected or is a bug in beta?

    Regards,

    Craig.

  • In order to promote the people picker field you need to promote the fields under the group node not the group node itself.  For example, if you want to show the display name then you will need to promote the DisplayName node.

    The rules should work if you set the AccountId node instead of the DisplayName node.  The AccountId node should  be populated with the domain/alias.

  • This is a great advance, but is there a way to view the selected users' email? In Infopath 2007, I had to create additional text boxes and rules to get the email (as in this article: alecpojidaev.wordpress.com/.../infopath-codeless-programming-walkthrough). Does this improve any in 2010 ?

  • Melissa, as far as I know these additional steps are still required. To confirm that this is the case, I recommend that you post your question to the SharePoint 2010 forums:

    social.msdn.microsoft.com/.../threads

  • How do I enable the "Cannot be blank"? No matter what part of the control I select the "Cannot be blank" is disabled.

    How do I set the default value without having the user to press the lookup button? If I set anything in the AccountId - it just shows up in red text until the user presses the button.

  • In response to Lars Bo Wassini:

    To enable cannot be blank on the person/group picker, select the control in the designer and then go to the Properties tab in the ribbon.  In the Modify group, enable the Cannot Be Blank checkbox.  If this is disabled, can you please provide more context regarding your form?  Are you customizing a SharePoint list?  Is your form using an imported schema? Etc. Have you upgraded the control to the 2010 people picker? If not, read the following blog post on how to do this: blogs.msdn.com/.../upgrading-infopath-2007-forms-with-person-group-pickers-to-infopath-2010.aspx

    Default Value: Is is this issue occurring in the InfoPath client only? It should work by default when filling the form out in the browser. However, if you want the name to not appear in red you can set the DisplayName field to the same value as the AccountId.

  • I used the group for "Person/Group Picker to link to my email connection wizard, address field of "TO:" But when i click submit form the error prompts;

    "InfoPath cannot submit the form.

    An error occurred while the form was being submitted.

    The form cannot be submitted because some of the e-mail addresses cannot be resolved. If you know the values in the form that specify the e-mail addresses, revise them and try again.

    The following addresses did not resolve in the To line: FAREAST\v-biho"

  • The people picker does not display e-mail addresses. It displays user names. Domain\Username is not a valid e-mail address. This is why it won't resolve. For the e-mail submit to work, you need a valid e-mail address such as username@microsoft.com.

  • When I publish the AccountID and the Display Name, both fields display as domain\user.  Any insight as to why Display Name is not coming through properly?

  • Is there a way to set an "Action" rule for a People/Group field?  We would like to retrieve user profile data for the user selected in the People/Group field without having to write code.  Unfortunately, the option to create an "Action" rule against a People/Group picker field is disabled.  

  • Action rules based on the person field are not supported in InfoPath 2010. You will need to use code to do this.

  • We created code for handling the Person/Group field "Changed" event and attempted to deploy the form template as a sandboxed solution, but received the error "Code events on Person/Group Picker controls are not supported in sandboxed solutions."  Is there a way to enable Person/Group field event handling for InfoPath forms deployed as sandboxed solutions?

  • Funny, I dont have the SharePoint Server Tab under People Picker Properties what it shows under my Data Tab though is: that I must create a secondary data source and shows a format as <Context siteUrl="http://servername"/>

    Any ideas? I am running Office version 14.0.4763.1000

  • I have several people pickers in an InfoPath 2010 form -- a couple bound to single-occurring elements and another bound to an element within a repeating group which is laid out in a Repeating Table.

    Any idea why when as I enter data in different fields in the form, the people pickers disappear for a second, then reappear?  

    It does it in the client as well as if rendered in the browser on a SharePoint 2010 Server.  In the latter case, using a mouse to move about the form is a tricky affair as while the pickers are doing their vanishing act, the whole form is jumping all over the place! :o  

    I tried turning off the postback on all fields, except the people picker which doesn't have that option.  That didn't fix it.  Any other ideas?

    Thanks! :)

  • is it possible to prevent postback on this control?  it is resetting the caret and makes it impossible to tab through fields

Page 1 of 4 (51 items) 1234