开发者

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker?When I add the peop开发者_运维知识库le/Group picker into the infopath form, I only get 3 fields DisplayName,AccountId,AccountType.Can anyone show me how can I get the email either by configurations or by code.


In SharePoint Designer, when setting up a workflow to respond to an InfoPath people picker field, I simply map the "TO:" field of my "Send Email" action to whatever people picker field I have (even if it's set to pull the Display Name)... and the email will successfully send out regardless. Now, your mileage may vary and perhaps it's due to our Exchange server settings and small company size which allows this to work.

Anyways, try it out. Maybe extracting an email address from the people picker is a superflous step.


I have a simpler solution.

Assume you are using the connection wizard to send an email to a person selected from a people picker.

in the to field -

concat(substring-after(AccountId, "\"), "@domain.com")

assuming your companies mail accounts have an entry for username @ domain.

because AccountId = domain\username

so we end up with username@domain.com

Worked for me


  • Create a button and the following rules for that button.
  • Create a data Connection to retrieve from GetUserProfileByName.
  • Create a field to store the email you are retrieving.

Rules for the button

Rule 1 Set a fields value. Set the value of the AccountName of GetUserProfileByName to equal the AccountID from the people picker.

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker

Rule 2 Add an Action to to Query the Data Connection GetUserProfileByName

Rule 3 set a fields value to the email address of the query you just performed

How can retrieve email address from the Infopath people/Group picker

Filter Data

How can retrieve email address from the Infopath people/Group picker

Change value to name

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker


If you simply want to populate a field with the email address from your domain this works perfectly. I have been banging my head on the double eval trick for two days. I got it to work but the form rendering in SharePoint took 2 minutes and 46 seconds.


I know this is too late for the answer but still i am writing this so that someone can get help in future.

When we keep People picker it gives us three values which you specified (AccountId, DisplayName and AccountType).

Now if some one wants to retrieve the email address, there may be so many requirement but i guess most of the person want to send mail to the user which are selected into people picker.

If you want to send mail to selected user then you can just use AccountId field into your workflow item. SharePoint designer automatically detect the email address from the AccountId and sends the mail.

I hope this might save someone's time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜