In this part of my InfoPath series I want to show you how you can use the SharePoint web services. The most interesting one is the GetUserProfileByName. This web service makes it possible to extract profile information, such as name or manager, from the SharePoint user profile. The form can automatically fill certain fields with these values. This saves the user a lot of time filling the form.
I want to continue with the hardware request form from the previous article. This form contains the fields Name, E-mail and Manager. These fields need to be automatically filled when the user opens the form. We can use the web service by adding a new data connection. Click at Data, From Web Service and SOAP. Now we only have to add the following URL:
In the following screen an overview of the available web services is presented. We only need the GetUserProfileByName. I click at Next until the we can rename the Data Connection. I would advice to use a name such as RetrieveUserInformation so you know what the Data Connection does 😉
The fields Name and Manager use the Person/Group control. It is not possible to set a default value at this control. We have to replace them with a text box control. I select the properties of Name and will change the default value. This can be seen in the following screenshot:
Now we have to click at Filter Data:
This is my last InfoPath blog for now, I will definitely talk more about it in the future 🙂