查找列在规则公式中使用ID代替标题 [英] Lookup column uses ID instead of Title in rule formula

查看:98
本文介绍了查找列在规则公式中使用ID代替标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个SP列表:合作伙伴和请求.

合作伙伴只有合作伙伴名称"列和ID列. /span>

在Request中,我有一个指向合作伙伴列表的查阅列.还有标题"列和请求日期"列.设置查找时,我将其设置为获取信息 在合作伙伴"列表的合作伙伴名称"列中,而不是在"ID"列中.

In Request, I have a lookup column pointing to the Partner list. There is also a Title column and a Request Date column. When I set up the lookup I set it to get info from the Partner list’s Partner Name column, not the ID column.

我与合作伙伴一起制作了一个InfoPath表单来提出新请求从下拉列表框中选择.提交此表格后,我想更改标题 字段是合作伙伴名称,逗号和请求日期的字符串连接.我制定了一个规则来做到这一点.我想要的示例:合作伙伴A,2010年8月27日".

I made an InfoPath form to make a new Request, with the Partner being selected from a Drop-Down List Box. When this form is submitted, I would like to change the Title field to be a string concatenation of Partner Name, a comma, and the Request Date. I made a rule to do this. Example of what I want: “Partner A, 8/27/2010”.  However, the result is that the Partner ID is used instead of the Partner Name and what I get is “1, 8/27/2010”.

(更多:在生产中,我将使用表单提交"规则来执行为了开发,我使用了一个在字段更改时运行的规则.如果我更改了下拉列表框 属性值属性(在数据"选项卡上)从d:ID到d:Title,该字符串的格式是所需的,但是该格式不会提交,并显示了仅允许使用正整数的工具提示.)

(More: In production I would use the Form Submit rule to do this. For development I used a rule that runs when the field changes. If I change the Drop-Down List Box properties Value property (on the data tab) from d:ID to d:Title the string is formatted as desired, but the form won’t submit and shows a tooltip that only positive integers are allowed.)

如何使规则使用公式公式中的合作伙伴名称"列而不是ID?

谢谢,

James.

推荐答案

在SharePoint中使用查找列时,它实际上同时使用ID和您选择查找并存储在其中的字段的值像这样的XML:1#; Partner.在浏览器中,您会看到合作伙伴",但是该值是超链接的.那是因为 它们只是向您显示一个友好的值,但真正的价值是我向您显示的连接字符串.这样做是为了使对原始项目的引用始终是唯一的.显示名称不是,因此该ID始终用于标识 项目.

When you use a lookup column in SharePoint, it actually uses both the ID and the value of the field you chose to look up and stores it in the XML like this: 1#;Partner.  In the browser, you see Partner, but the value is hyperlinked.  That's because they are only showing you a friendly value, but the real value is the concatenated string I showed you.  It does this so that the reference to the original item is always unique.  Display names are not, so the ID is always used to identify the item.

现在,我在想的是您遗漏了一些信息.这是我缺少信息的地方:

Now, what I'm thinking is that you left out some information.  Here is where I'm missing info:

  • 您说您制作了两个SP列表,其中一个是Request
  • 然后您说:我制作了一个InfoPath表单来提出新的Request."您编写此代码的方式就好像是您已经说过您在线程中先前创建的SP列表中的SEPARATE.您是说要点击自定义表单"在里面 现有的请求列表,以便您可以使用InfoPath对其进行修改?
  • 假设上面的答案为是",那么这意味着您在表单中的下拉列只不过是您先前描述的从合作伙伴列表中拉出的查找列.
  • 如果是这样,那么这就是下拉列表所绑定的字段将仅接受整数的原因.您需要做的是将查找分离.
  • You said you made two SP lists, one of which was Request
  • You then said, "I made an InfoPath form to make a new Request."  The way you wrote this was as if it was SEPARATE from the SP list you already said you created earlier in the thread.  Did you mean to say that you clicked "customize form" in the existing Request list so that you could modify it with InfoPath?
  • Assuming the above answer is "yes," then that means your dropdown column in the form is nothing more than the lookup column you described previously that pulls from the Partner list.
  • If so, then that's why the field that the dropdown is bound to will only accept an integer.  What you need to do is de-couple the lookup.

好吧,所以将查询去耦的意思是,如果您使用InfoPath来构建请求"表单,那么您就不需要做查找"列,因为这仅适用于使用OOTB列表表单.  请按照下列步骤操作:

Ok, so what I mean by decoupling the lookup is that if you are using InfoPath to build the Request form, then you don't need to do the lookup column, because that's really only for when using the OOTB list form.  Follow these steps:

  1. 删除合作伙伴查找列
  2. 将其重新创建为一行文本.
  3. 在请求"表单模板中,创建数据连接以从合作伙伴"列表中检索
  4. 将合作伙伴"文本框更改为下拉列表
  5. 配置该下拉列表,以接收来自合作伙伴数据"连接的外部数据
  6. 将值"和标题"设置为合作伙伴"字段(无ID)
  7. 发布并尝试
  1. Delete the partner lookup column
  2. Re-create it as a single line of text.
  3. In the Request form template, create a data connection to retrieve from the Partner list
  4. Change your Partner text box to a dropdown
  5. configure the dropdown to receive external data from the Partner data connection
  6. Set the Value and Title as the Partner field (no ID)
  7. Publish and try it

PS.没有理由不对标题"字段使用简单的规则或默认值.只需确保它不可见或被禁用,以使用户不要在其中输入任何内容.我还认为在标题中添加逗号和空格是一个糟糕的主意,但这是 取决于你.

PS. No reason not to use a simple rule or default value for the Title field.  Just be sure it's either not visible or disabled so that users don't type anything in it.  I also think it's a poor idea to put a comma and space in the Title, but that's up to you.


这篇关于查找列在规则公式中使用ID代替标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆