从同一列表中的另一个列表项中提取数据 [英] Pulling data from another list item in same list

查看:72
本文介绍了从同一列表中的另一个列表项中提取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我正在尝试找到一种方法,根据列条目我可以在同一列表中有一个列引用另一个项目,然后从另一个项目列中提取数据。


我还需要尝试使用SP out-of-thebox实现此目的,没有第三方插件。


更具体地说,拥有一个包含的文档库两种文件;提交和附件,我已经为每个创建了内容类型,因此我可以为每个提供不同的元数据字段
。保存"提交"时,我们输入提交编号,提交者名称和提交者组织。然后<跨度>&NBSP;
'title'是一个计算字段,它以指定的格式将所有信息放在一起。


用户输入:

提交编号: 14

提交者姓名: Sam Smith ,以及
提交者组织:麦当劳



进入各自的领域,并且提交的标题填写;



提交14 - Sam Smith - 麦当劳


我做得很好。我现在的问题是附件。我希望能够输入附件所涉及的提交编号,并从该提交中提取标题字段
编号 - 然后是最后的附件编号和附件名称。


提交编号:
14 (现在是文档库中的项目)

附件编号: B

附件名称:附录


从中,有标题字段填充:


提交14 - Sam Smith - McDonalds - 附件B - 附录


这有两个部分,一个是使用IF公式根据内容类型(提交或附件)应用不同的公式,我想我已经找到了关于这样做的说明。


但我无法解决的是这个;

我需要附件内容类型的公式来查找具有指定提交编号的同一列表中的项目,然后从该项目中获取标题字段并将其作为标题字段的开头放入为附件。简单的部分是
然后将附件编号和名称附加到它的末尾。


我希望这是我的意思。

解决方案

您好达拉斯,


对于附件内容类型,如果您想获得相关的提交者名称和组织根据现有的提交编号,您可以通过Rest API实现此功能,然后附加值并填充到特定字段,这里是
的代码演示您的参考,列表名称是"docs":

< script src =" https://code.jquery.com/jquery-1.10.2.js"类型= QUOT;文本/ JavaScript的">< /脚本> 
< script type =" text / javascript">


(document).ready(function(){

setInterval(function( ){runco​​de()},1000);

});

函数runco​​de()
{
var number =


(" input [title ='Submission Number']") .VAL();

Hi all

I am trying to work out a way where I can have a column reference another item in the same list according to a column entry, and then pull data from another one of that items columns.

I also need to try to achieve this with SP out-of -thebox, no thrid party plug-ins.

To be more specific, have a document library that contains two types of documents; submissions and attachments, and I have created content types for each so I can presents different metadata fields for each. When saving a ‘submission’ we enter the submission number, submitter name, and submitter organisation. Then  ‘title’ is a calculated field which put all that information together in a specified format.

User enters:
Submission Number: 14,
Submitter name: Sam Smith, and
Submitter organisation: McDonalds

into the respective fields, and the title filed populates with;

Submission 14 – Sam Smith – McDonalds

I have done that part fine. My issue is now with attachments. I want to be able to enter the submission number that the attachment relates to and have it pull the title field from that submission number - then the attachment number and attachment name at the end.

Submission number: 14 (which is, by now, an item in the doc library)
Attachment number: B
Attachment name: Appendices

and from that, have the title field populate with:

Submission 14 – Sam Smith – McDonalds – Attachment B – Appendices

There are two parts to this, one is to use an IF formula to apply a different formula depending on the content type (submission or attachment), and I think I have found instructions on doing that.

But what I can’t work out is this;
I need the formula for the attachment content type to look for the item in the same list with the specified submission number, then take the title field from that item and put it in as the start of the title field for the Attachment. The easy part is then appending the attachment number and name to the end of it.

I hope that makes sense what I am trying to do.

解决方案

Hi Dallas,

For the attachments Content Type, if you want to get the related Submitter name and organisation based on the existing Submission Number, you could achieve this by Rest API, and then append the value and populate to specific field, here is a code demo for your reference, list name is "docs":

<script src="https://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">


(document).ready(function () { setInterval(function(){ runcode() }, 1000); }); function runcode() { var number=


("input[title='Submission Number']").val();


这篇关于从同一列表中的另一个列表项中提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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