User list in infopath via the People web service
There has been a tricky problem in infopath for a while trying to get a user list in a drop down box. You can do this with the people web service. The problem has been it is almost impossible to find documentation on the thing and you have to know a few tricks to get it to work. Here are the steps from within Infopath.
Note: It only pulls people that have been to your sharepoint top level site.
1. Go to Design Tasks
2. Click on Data Source
3. Click on Manage Data Connections...
4. Once you are in the Data Connections Dialog box click Add
5. Choose Create a new connection and select Receive
6. Click Next
7. Choose Web Service
8. Click Next
9. Enter the url of the people.asmx web service (i.e. http://yoursite/_vti_bin/people.asmx)
10. Click Next
11. Choose Search Principals from the Select an operation: box.
12. Click Next
13. You are going to want to set the values for parameters.
14. tns:searchText should be your domain with a \ behind it (i.e. domain\)
15. tns:maxResults* should be a number greater than the results (i.e. 1000)
16. tns:PrincipalType should be the word User
17. click Next
18. click Next and then click Finish
19. Now you can click Close to close the Data Connection Dialog Box
20. Place a Drop-Down List Box on the form.
21. Under List box entries choose Look up values from an external data source
22. Choose SearchPrincipals as the data source.
23. Click on Entries
24. Expand until you see Principal Info and choose it
25. Choose DisplayName for DisplayName and whatever field you want for Value (i.e. AccountName or DisplayName)
No comments:
Post a Comment