InfoPath下拉列提供了两个列表选择 [英] InfoPath Dropdown column to provision two list choices

查看:220
本文介绍了InfoPath下拉列提供了两个列表选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要在哪里构建InfoPath表单的要求.

这是列表表单,最主要的是此表单需要提供两个不同的SharePoint列表选择.

我正在尝试使用单个Dropdown控件访问两个SharePoint列表.

当用户使用时从下拉列表中选择列表A,我希望他们查看列表A的所有相关列并填写列表表单.  

当用户使用时从列表中选择列表B Dropdown ,我希望他们这样做查看列表B的所有相关列并填写列表.  

谢谢


Abenet

解决方案

如果您想使用单个Dropdown控件访问两个SharePoint列表,则可以从xml文档中有多个列表.然后,您可以使用 XML文档中的项目(按代码). 过滤器 下拉列表中的值基于另一个下拉列表中的值(列表名称).

有关如何使用多个列表中的值填充下拉下行链路的更多详细信息,请参见以下线程:

https://social.msdn.microsoft. com/Forums/exchange/zh-CN/4c919e1c-c1fa-4294-b7b9-811546518ec5/infopath-populating-drop-down-list-box-from-multiple-sharepoint-lists?forum = sharepointcustomization

有关如何为下拉列表设置过滤器的信息:

https://support.office.com/zh-CN/article/Filter-the-在Control-7c9471ed-46e6-40fc-93b6-8f25e5fa4deb中显示的数据

作为另一个解决方法,您可以为列表A和列表B创建下拉列表.使用规则隐藏当用户选择另一个列表时使用列表A作为数据源的下拉列表 列表.

1.创建一个名为"listname"的下拉列表,然后输入列表名称作为选择,例如:list A,list B.

2.将数据连接添加到列表A和列表B.

–在功能区的数据"选项卡下,单击数据连接"并添加数据连接.

–接收数据.

–在选择数据源"中,选择"SharePoint列表库",然后单击下一步". /span>

–在SharePoint网站详细信息屏幕中,单击下一步"按钮.

–在选择库列表"中,选择列表A",然后单击下一步"按钮.

–在选择的字段中:选择您的字段,然后单击下一步"按钮.

–输入连接名称,然后单击完成"按钮.

3.创建一个名为"listA"的下拉列表,并使用列表A"数据源中的值.并为列表B创建一个名为"listB"的下拉列表.

4.当"listname"的值为"listB"时,隐藏"listA".

–右键单击"listA",为此字段添加规则.

–当列表名称"值为列表B"时,隐藏此控件.


5.另外,当列表名称"的值为列表A"时,请按照4隐藏列表B".

最好的问候,

Linda Zhang


I have requirement where I need to build InfoPath form.

This is List form, and the main thing is this form needs to provision two different SharePoint List choice.

I am trying to access two SharePoint lists with a single Dropdown control.

When a User chose List A from the Dropdown, I want them to see all related columns for list A and fill the list form.  

When a User chose List B from the Dropdown, I want them to see all related columns for list B and fill the list form.  

Thanks


Abenet

解决方案

Hi Abenet,

If you want to access two SharePoint lists with a single Dropdown control, you could add the items from multiple lists into the xml document. Then you could populate the dropdown with items from an XML document by code. Filter values in drop down list based on the value (list name) in another drop down list.

Refer to the following thread for more details about how to populate the drop downlink with values from multiple lists:

https://social.msdn.microsoft.com/Forums/exchange/en-US/4c919e1c-c1fa-4294-b7b9-811546518ec5/infopath-populating-drop-down-list-box-from-multiple-sharepoint-lists?forum=sharepointcustomization

Information about how to set a filter for a drop down list:

https://support.office.com/en-us/article/Filter-the-data-that-is-displayed-in-a-control-7c9471ed-46e6-40fc-93b6-8f25e5fa4deb

As another workaround, you can create drop down lists for list A and list B. Using the rule to hide the drop down list which use the list A as the data source when user selects another list.

1. Create a drop down list called "listname" and enter the list names as the choices, for example: list A, list B.

2. Add data connections to list A and list B.

– Under Data tab on the ribbon, click Data Connections and add a data connection.

– Receive Data.

– In Select the source of your data, choose SharePoint library of list then click Next button.

– In SharePoint Site details screen, click on Next button.

– In Select a list of library, choose List A and click on Next button.

– In select fields: Choose your fields then click on Next button.

– Enter name for the connection then click Finish button.

3. Create a drop down list called "listA" and use values from List A data source. And create a drop down list called "listB" for List B.

4. Hide the "listA" when the value of "listname" is "listB".

– Right click on the "listA", add rule for this field.

– When the "listname" value is "list B", hide this control.


5. Also, follow the 4 to hide the "list B" when the value of "list name" is "list A".

Best Regards,

Linda Zhang


这篇关于InfoPath下拉列提供了两个列表选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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