Auto-retrieve the email address of user in the Person/Group Picker of InfoPath 2007
-
22-10-2019 - |
Question
Is it possible for a web-based InfoPath 2007 form to auto-retrieve the email address of a user and display on a text field after the end-user had select it in the Person/Group Picker? (For SharePoint Server 2007)
Scenario:
A form with two field - one is text field while another one is a person/group picker field. When a end-user select a person or group from the person/group picker field, the email address will auto display at the text field.
Solution
You can use User Profile Service Web service (http://ServerName/_vti_bin/UserProfileService.asmx) to retrieve a user's email.
You can use code or no code solution:
OTHER TIPS
You can get the AccountId from the PeoplePicker and then query the UserProfileService as vedran suggested. However, if you want a no-code solution, it will be a little tricky since the PeoplePicker does not support rules.
You will need a seperate field which holds the AccountId as default value which you then can use to query the webservice.