如何从 Infopath 人员/组选择器中检索电子邮件地址

发布于 2024-10-07 14:03:56 字数 133 浏览 0 评论 0原文

如何从 Infopath 人员/组选择器中检索电子邮件地址?当我将人员/组选择器添加到 infopath 表单中时,我只得到 3 个字段 DisplayName、AccountId、AccountType。谁能告诉我如何通过配置获取电子邮件或通过代码。

How can retrieve email address from the Infopath people/Group picker?When I add the people/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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

梦魇绽荼蘼 2024-10-14 14:03:56

在 SharePoint Designer 中,当设置工作流以响应 InfoPath 人员选择器字段时,我只需将“发送电子邮件”操作的“收件人:”字段映射到我拥有的任何人员选择器字段(即使它设置为拉显示)姓名)...无论如何,电子邮件都会成功发送。现在,您的情况可能会有所不同,这可能是由于我们的 Exchange 服务器设置和公司规模较小而使其能够发挥作用。

不管怎样,尝试一下吧。也许从人员选择器中提取电子邮件地址是一个多余的步骤。

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.

陌上芳菲 2024-10-14 14:03:56

我有一个更简单的解决方案。

假设您正在使用连接向导向从人员选择器中选择的人员发送电子邮件。

在“收件人”字段中 -

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

假设您公司的邮件帐户有一个用户名@域条目。

因为 AccountId = domain\username

所以我们最终得到 [电子邮件受保护]

为我工作

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 [email protected]

Worked for me

在风中等你 2024-10-14 14:03:56
  • 创建一个按钮并为该按钮创建以下规则。
  • 创建数据连接以从 GetUserProfileByName 检索。
  • 创建一个字段来存储您正在检索的电子邮件。

按钮的规则

规则 1 设置字段值。将 GetUserProfileByName 的 AccountName 值设置为等于人员选取器中的 AccountID。

在此处输入图像描述

在此处输入图像描述

规则 2 添加操作以查询数据连接 GetUserProfileByName

规则 3 将字段值设置为您刚刚执行的查询的电子邮件地址

在此处输入图像描述

过滤数据

在此处输入图像描述

将值更改为名称

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

  • 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.

enter image description here

enter image description here

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

enter image description here

Filter Data

enter image description here

Change value to name

enter image description here

enter image description here

enter image description here

enter image description here

土豪 2024-10-14 14:03:56

如果您只想使用您的域中的电子邮件地址填充字段,那么这非常有效。这两天我一直在研究双重评估技巧。我让它工作了,但 SharePoint 中的表单渲染花了 2 分 46 秒。

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.

时间你老了 2024-10-14 14:03:56

我知道现在回答已经太晚了,但我仍然写下这篇文章,以便将来有人可以获得帮助。

当我们保留人员选择器时,它会为我们提供您指定的三个值(AccountId、DisplayName 和 AccountType)。

现在,如果有人想要检索电子邮件地址,可能会有很多要求,但我想大多数人都想向被选入人员选择器的用户发送邮件。

如果您想向选定的用户发送邮件,那么您只需在工作流程项目中使用 AccountId 字段即可。 SharePoint 设计器自动从 AccountId 中检测电子邮件地址并发送邮件。

我希望这可以节省某人的时间。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文