Person / Group Picker Improvements in InfoPath 2010


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

Comments (55)

  1. craig@thesystemexperts.com says:

    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.

  2. infopath says:

    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.

  3. Melissa says:

    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 ?

  4. infopath says:

    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

  5. Lars Bo Wassini says:

    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.

  6. infopath says:

    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.

  7. Leslie Ho says:

    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: FAREASTv-biho"

  8. infopath says:

    The people picker does not display e-mail addresses. It displays user names. DomainUsername 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.

  9. Gina W. says:

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

  10. zb123 says:

    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.  

  11. infopath says:

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

  12. zb123 says:

    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?

  13. Mark says:

    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"/&gt;

    Any ideas? I am running Office version 14.0.4763.1000

  14. ChapmanStickPlayer says:

    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! 😮  

    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! 🙂

  15. tony says:

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

  16. jriesen says:

    This is well and good, but I want to be able to see the list of users in the group so I don't have to guess at the names.  I am finding very little useful (no-code) information on the internet.  I would think this is a very common request especially if an organization is using role-based security in Active Directory and they don't want to use SharePoint groups.

    Any suggestions?

  17. Abram Kaufman abramk@pcmall.com says:

    OK, but how do you promote the person/group field in InfoPath as a person/group field in the SharePoint form library?

  18. hhrafn says:

    I'd also like the possibility to promote (publish) the person/group field as you can with lists.

  19. Need more Help says:

    I still do not understand why you can only pull down the users name, Network Username and type witout rewriting code.  There has to be an wasier way to query Active Directory and fill a form with this information.  Any ideas?

  20. Picker gains width when emailed to outlook says:

    Infopath 2010 > SharePoint 2010 > Exchange 2010 > Outlook 2010.

    My form is working until I email the form from SPS 2010 to myself. Viewing the form in my inbox, formatting of the form included in the body of the email does not look like it did in Infopath. When I open the email the area that takes up the form exceeds the width of my viewing window and requires scroll bars to see all the fields on the form.

    When printing the form from my email the area is so large that no data will show up in the printable area (it appears to be centered on the form and it is cutting off the "extra content" to the left and right which contains the form data as the user entered it). I also forwarded the email to a person who's using Outlook 2010 and they experienced the same problems as myself.

    Is there a trick to set up for Forms Services before it converts the form to an aspx page? brockett99(at)gmail.com

  21. Tara411 says:

    Why dont I see the Sharepoint Server Tab? I am using InfoPath 2010

  22. Gergely says:

    Tara411,

    The SharePoint Server Tab is only present for InfoPath Filler forms (see File/Form Options/Compatibility) because there's no guarantee such forms will be linked to a SharePoint site. Once a template is published to a site, the people picker resolves against that site.

  23. Joel says:

    No, it doesn't. Well, at least when publishing to SharePoint 2007 it doesn't. I'm still having to add Context.xml as a data connection.

    Anyone know how to get the People Picker to automatically set itself to who opened the form? I tried setting AccountId to userName() as a default value, but it didn't work

  24. Sebastian says:

    I'mtrying to use the People Picker, but it does not appear in the Form. There occurs an error: "One or more ActiveX Controls could not be displayed". There appears only the small red x in the form instead.

    Any suggestions? This should be something with the IE security settings of my company, but which setting is it?

  25. Sudhir Rawat says:

    How to promote the people picker value to Form library Person and group column?

  26. Yogesh says:

    is it possible to add validation rule to Person control bound to SharePoint group like must have value when another field is set or so?

    I don't even get the option to set cannot be blank but I guess that's due to the field which is set to allow blank

    else I wanted to put validation on submit button but it doesn't allow it

  27. Tyler says:

    Still lacking out of the box way to select email or other user profile information… in read only mode it will always display the DisplayName — can't even output the presence information?  SIGH.

  28. xyz says:

    I want two fields on people picker change event. But i am getting an error box specifying Error in processing the form.

    Also it specifies that error in call back

  29. Robin says:

    We use a form to create and modify users ad accounts. The contact selector only retrieves active accounts. Unfortunately, when the person submitting the form enters a user name that for a person with an expired account they receive an ugly error. Is there a way to pull active and expired accounts?

  30. Géraldine BELIER says:

    Hi,

    Like Lars Bo Wassini, I cannot tick the check box "Cannot be blank".

    My InfoPath form is a workflow form for a workflow created with Nintex in a SharePoint 2010 library.

    Regards,

    Géraldine

  31. Mahen says:

    If I add the people picker control to the form it puts it into a repeating group – so I am unable to promote the DisplayName to a SharePoint column.

    The group is also locked so I can't remove the check mark for Repeating.

    How can I get around this?

  32. Scott Heim says:

    Hi Mahen,

    You are correct – the data structure for this control cannot be changed as it returns data based on that schema. So if you could change it, you would break the control. In addition, these nodes store the data as text (strings) so you cannot promote this to a "Person" column in SharePoint if that is your ultimate goal. If you want to promote just the Display Name column, you can – it just won't be a "Person" node. If the goal is to get this information into a "Person" node, then you can easily do this by promoting the AccountId node as a string and then use a SharePoint Designer workflow that starts when a new item is created and/or an existing item is updated and it simply sets your "Person" node to the value in the AccountId node.

    Scott

  33. rwiethorn says:

    Hello Frank,

    My customers are getting '..CallBack Errors' when they try to use the control in a form I designed.

    The form is for a Form Library.

    When I use a List Library the control/form works ok.

    This is on a Company intranet.

    My Customers are in China, I'm in Ohio.

    Can this be a timeout error?

    Also, I did not specify the URL in the 2nd tab of the controls properties. I deploy the form, and assumed the URL would be realtive to the Sharepoint Site.

    Any advice on how to overcome the error?

    Thanks,

    Rwiethorn

  34. Aping Tan says:

    We have encountered a strange behaviour of People Picker (SharePoint 2010 + Infopath 2010). Normally we need to click "Check Names" on the verify button in order to detect the user entered in the people picker. This is the behaviour we expect of infopath and SharePoint.

    However if there is any postback triggered of a control in the infopath, the people picker will then auto verify the user name (without click on the verify button). How we can do to prevent the auto verify user name of people picker?

  35. Hi Scott,

    I want a combination of friendly display of people and I want the person object (with looks unfriendly, especially with claims where the domainusername has a "i:0#.w|" prefix).

    I think you are suggesting: use the people picker control in the form but promote the display name (that gives me my friendly display of people). Since I also need the account id, create additional columns (people groups type) directly in my form library and populate those values on create and modify actions using a Workflow.

    So if I have 3 people pickers, I actually need 6 columns in my form library.

    Did I get it right.

    Greg

  36. Hi Greg,

    Yes – that is correct. However, once you populate a Person/Group node with the accountId, won't it display the "friendly" name? If so, then you just need to promote that one column as a string.

    Scott

  37. Sara says:

    I am having a problem where the Person Picker does not get selected when in error. All other "native" controls do.

    How can I fix this?

  38. Ram says:

    I have a SharePoint 2010 Infopath List form. In this form I have a people picker field and a Date picker field. Now I need to make people picker field Mandatory only when Date picker field is not blank. How can I do this as Action, validation are not available for People Picker and we cannot use custom code for an Infopath List form ? Please suggest.

  39. Hi Ram,

    You are correct – there is not a way to add "formal" data validation to the People Picker control. But you can change the design just a little and get almost the same result. Here is an example:

    NOTE: My Person column is called: MyPerson and my date column is called: MyDate

    1) Add a new button to the form (this will be your Submit button now)

        – Right-click the button, choose Properties and set the Action to: Submit

        – Click the Submit Options button on the Ribbon (Data tab) and uncheck the option "Show the Submit button in both the Ribbon and the Info tab…"

    2) Add a new "Formatting" rule to the button as follows:

        – Condition:

             – If MyDate is not blank and AccountId is blank or Person is not present

        – Formatting:

             – Disable this control

    ** What this will do is disable the Submit button if a date has been entered/selected and the AccountId node for the Person control is still blank. (This gets populated when the name is validated.)

    3) Add a "Calculated Value" control next to the People Picker control and set the text property to an asterisk (I made it bold and red as well.)

    4) Add a "Formatting" rule to this Calculated Value control as follows:

        – Condition:

             – If MyDate is blank or MyDate is not blank and AccountId is not blank

        – Formatting:

             – Hide this control

    ** What this will do is show the red asterisk (like a required field) when a date has been entered and the AccountId node for the Person control is still blank.

    Although this is not true data validation Ram, it will prevent submitting the form if a date has been entered but a name has not been validated in the Person control.

    I hope this helps!

    Scott

  40. Tabbing Issue says:

    Hi,

    Did anyone ever figure out what to do with the tab back problem that the picker causes?

    Thanks,

    Sara

  41. i can understand on sharepoint share can you explain more…. clear???

    http://www.pembolang.com

  42. Bhisham says:

    Hi, I am new to Infopath and have created one form with the help form Internet,now i am stuck in, i have already published the form on SP. I want when somebody opend the form it should come up with User name & email ID automatically, its possible i have seen in one form but dont know how to do this.

    Thanks in advance!!

  43. Curtis says:

    In using 2010, does it correct this issue?

    • Problem: While the initiator fills out the form the contact selector works just fine. But when the  approver opens the form from Outlook we get the following message when we try to validate a user in the Contact selector: "This action cannot be performed from untrusted sites. To use Find, you must add this site to the list of trusted sites for your Web browser."

    • The reason you are seeing this behavior is when you open an InfoPath form from within Outlook it is being opened in the local IE cache (Temporary Internet Files) – as such, you will see this message. To allow the Contact Selector control to work in that scenario the form will need to be saved to the user's machine.

  44. Karen B says:

    When I try to use the people picker in InfoPath 2013, it causes InfoPath to crash.  Any ideas?

    Problem signature:

     Problem Event Name: APPCRASH

     Application Name: INFOPATH.EXE

     Application Version: 15.0.4420.1017

     Application Timestamp: 5067334b

     Fault Module Name: PEOPLE~1.DLL

     Fault Module Version: 15.0.4420.1017

     Fault Module Timestamp: 506733e2

     Exception Code: c0000005

     Exception Offset: 0000f279

     OS Version: 6.2.9200.2.0.0.256.4

     Locale ID: 1033

    Additional information about the problem:

     LCID: 1033

     skulcid: 1033

  45. Juli Reid says:

    I hate to say it but this is not the best thing you guys ever did.  I need a similar control but one that validates against Active Directory and not SharePoint.  You took that functionality away.

  46. Jeff says:

    I added a Person column to a list and the person shows up as a hyperlink from the list view.  When I click on the person I get the user details.

    But when I add the person as a field to an InfoPath form, the name loses the hyperlink when viewed from the form.  

    Is there anyway to have the person hyperlinked from the form?

  47. gmoore says:

    This for some reason does not apply to my 2010. i do not have the funtions you show here like the sharepoint server tab…?

  48. Raj says:

    I have an InfoPath 2010 form which is published to a form library in SP2010. I have added a Person/Group Picker control in the form which is intended to show only a particular group of people in my SP Site. For this I have selected the SharePoint Group property of the control and everythign set working in my development environment.

    But when I deploy this to production or other environment, the group setting seems to be not working there. I heard this control stores the Group by Id and not by the name and may the reason for this failure. Is there any workaround for this situation?

    thank you beforehand.

    raj

  49. Ana says:

    I am developing a collaborative site with SP 2010 and I've used an InfoPath form as contact information, including a person/group picker named "Contact" associated with Lync database.

    When I add the webpart with the form in it to the SharePoint the field "Contact" is displayed as text and not redirected to the Lync contact information.

    Is there any way to fix this?

  50. John Gates says:

    No SharePoint Server or General tabs showing in Person/Group picker Control Properties :-

    We have set up a SharePoint 2010 development environment on a Windows 2008 R2 server. We've installed VS2010 SP1, Excel 2010 & InfoPath 2010. For some reason the InfoPath Person/Group picker generates controls that only have 3 tabs; Data, Size and Advanced in the properties. There are no SharePoint Server or General tabs showing. Any ideas on how to rectify this? Note we've only ever had InfoPath 2010 so it’s not a problem of migrating from InfoPath 2007.

  51. Tracy Nelson says:

    Frank,

    I need to use a Rule on my InfoPath form to set the Person or Group field on my InfoPath Form Library.  I'm trying to use the [Me] keyword to filter the views on my form library bases on EDIPI numbers.

  52. Richard says:

    Hello all. My 2010 people picker works as advertised. However, I have 8 people picker fields. I need to 'Publish' 4 of them to SharePoint. They are all called "AccountId" and it is difficult to distinguish one from the next. Am I missing an easier way to determine which 'AccountId' belongs to which field? Thank you in advance.

  53. Goes says:

    nice blog, very useful and wish you more creative in making a useful article, a successful greeting.

    Regards http://www.seogereggi.com

  54. Guy says:

    I am having problems with People Picker control.

    If I add a people picker to a new empty form and publish to a new library on our SharePoint forms server as a browser enabled form it works OK.

    If I add a people picker to an existing form and publish it in the same way, deleting the library and creating a new one, it only partially works.  If I enter, "Smith", in the people picker and click on check names button it successfully finds the ten or so people called Smith in our organisation and asks me to choose one.  So it must be connecting to the correct server to find data.

    If I enter my name, "Guy", it doesn't find me, "Guy Boswell" but brings back another person called, "Richard Guy".

    And the browse button doesn't do anything whereas on the new blank form it brings up a search box.

    So something in my existing form is interfering with the people picker.  Any ideas where I should start looking?

  55. sue standen says:

    Hi I have the People picker control on my form allowing more than one user to be chosen.  On the email submit button I would like to choose the people picker field to display more than one user name if chosen.  What is the function I need to put in the email cc line to ensure both names display.  I have tried Concat(displayname)and Concat(group1) for example and this causes an error.

    Thanks

    Sue

Skip to main content