Creating a people picker form in InfoPath 2010

The School I work at is undertaking a massive project to try and remove all forms of unnecessary paperwork. You know the ones

  • Course request
  • Cover request
  • Leave of absence
  • Duty swap


These are only a few, not counting the paperwork we send home to parents. So we decided to start small to see how it worked, could we make it simple and would staff cope with the changes.

I am going to break the process down into a series of post otherwise it would be a very long read. This first one is going to explain how to add a People Picker control and submit the form as an email.

Duty Swap

We decided to go with the duty swap form to start with, its currently a paper form that staff complete when they swap a duty with someone. The paper form is supposed to be a reminder that the swap has taken place and a copy goes to the duty team leader

Let me show you the finished article and then I can explain each step.


Creating The Form

Open InfoPath, in my case its InfoPath 2010


Select SharePoint Form Library and click Design Form


You can now edit all the headings etc to suit your needs and then lets add a people picker control and text box

Adding Controls

To access the controls, expand the control section on the menu bar and select them from the list


Your screen will now look like this


On the right hand side you will now have a list of the fields you have just added, however they are not named very well


Double click the field heading and change the names to something relevant


Testing The Form

With these two controls added we can test the form, to do this click on the Preview button at the end of the ribbon


If you type into the people picker control however, you will get an error


This is because the control has nothing to talk to. During runtime it will talk to the SharePoint site the form is published to and use the user profiles service to retrieve users details. To overcome this issue while we design the form we need to tell it the URL of the SharePoint site. To do this double click on the people picker control and select Control Properties


Click on the SharePoint Server tab and enter the address of the server


Now when you preview you the form it will return the username


Creating A Formula

We now need to fill in the text box with the email address of the user. This is going to require a formula to take details from the people picker control

If you look at the people picker control it pulls through the following data

  • DisplayName
  • AccountId
  • AccountType


We can use the AccountId to produce the email address, if you use InfoPath to complete the form you can use the AccountId to send the email but we are going to fill the form in using a web browser so we need to produce a full email address.

Double click on the text box control and select control properties from the ribbon


Click on the fx button

The AccountId will be returned from the system in the format of domainusername we need to take this and use just the username to add to the email address. For this we will need to use two functions

  • substring-after – This function looks at the AccountId field and only uses the text after the
  • concat – This function concatenates (joins together) the selected text from the AccountId and the rest of the email address

Here is the code and as it should appear on the screen

concat(substring-after(AccountId, ""), "")


So now lets see what happens when we use the people picker to search for a user


Submit The Form

Our form now has enough information in it for it to be submitted to someone by email. In this example it will be setup to submit an active view of the form to the user selected in the people picker

To do this we need to create a data connection to submit the form

From the ribbon select the Data tab and then click on To E-mail


Click on the function key next to the To: text box


Click on Insert Field or Group and select the text box field that will contain the email address


Select the option to send only the active view of the form


Give the data connection a name and then click Finish


Now lets preview the form again only this time click Submit once you have selected someone in the people picker


Once you click on Submit you should receive an email with the active view of your form like the one below


So we have a form that will allow the user to find people from within the organisation and then submit the form as an email to that user. That’s great but it doesn’t really do anything else. Part 2 of this series will add more controls and as well as submit the form as an email will save the data to SharePoint for further analysis.

9 Responses to Creating a people picker form in InfoPath 2010


    This is a great post, and everything works perfectly. But what would the formula look like if you could select multiple people in the people picker? I am only able to get the first person in the list to show up in the email. Any suggestions?

    • To be honest I have had exactly the same issue and at the moment not found a solution


        Did anyone find a solution for picking more than one person?


    Hi arichards,

    Did you find the solution for the multiple people in the people picker, please let me know if you have the solution.



    Pingback Nilesh Rathod


    hi is there any way to use person picker without sharepoint server. or is there any way to connect GAL when there is no sharepoint server.

    • The people picker in InfoPath actually uses the user profile service in SharePoint so without that working it won’t find anything


    Click the General tab in the Person/Group Picker properties. Check the “Allow multiple selections” box. This will allow you to pick more than one person.

Leave a Reply

%d bloggers like this: