SharePoint Filtered Lookup Column in a List[Sharepoint过滤选项字段,无代码]

Sharepoint List Filter解释 立即下载

https://www.mriwm.com/Public/PamBlog/Lists/Posts/Post.aspx?ID=39

 

 

Out of the box no way currently exists in SharePoint to filter a lookup column to show only a subset of entries based on certain criteria. I found this post which got me most of the way to a solution but thought I would add a few points for clarification with screenshots as below.

One thing to note is that if you modify the New and Edit forms, you will subsequently break attachments. There is a hotfix to address the attachment issue but it requires deployment to the server and adds work to your modifications. In my next post I will show you how to filter a lookup using javascript which keeps attachments intact and avoids the entire hotfix issue.

Here's how to create a filtered lookup column:

  1. To start with create two lists where one is the lookup list (MyLookupList) and one is the list that would use the lookup list as a lookup column (Math Classes Offered). The names of my lists are in parenthesis for clarification.

     

  2. DON'T SKIP THIS STEP - In the list ("Math Classes Offered") that will use the lookup list (MyLookupList) create a Single Line of Text column and NOT a Lookup column. If you use a Lookup column, you will get an error when trying to save new or updated entries.

     

  3. In SharePoint Designer go to the Data Source Library tab. Right click on the lookup list (MyLookupList) and select Copy and Modify…

     

     

  4. In the Data Source Properties popup window, on the General tab enter the Name (FilteredLookup).

     

     

    On the Source tab under Query click on the Filter button and enter your Filter Criteria. Click Ok. You may also want to set the Fields by clicking on the Fields button (for best performance, reduce the fields to only those needed) and the Sort by clicking on the Sort button. Click Ok.

     

     

  5. On the Data Source Library tab right click on your newly created FilteredLookup from step 3 above and select Save As… Navigate to a location on your local machine and save the file (FilteredLookup.xml).

     

     

  6. Open the local file saved in step 4 (FilteredLookup.xml) in a text editor.
    1. Add { } around each of the 4 guids ( ="{ 17CFFB4F-665F-4F7F-9914-7DCE51312962} " )
    2. Add an id attribute right after the UseInternalName attribute and give it a value (id="FilteredLookup")
    3. Save the file with your updates but keep the file open
    4. Copy the text only from the starting to ending SharePoint:SPDataSource tags. Mine looks like below but yours will be different based on your list guid, the fields, sort, and filter values…

       

      <SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" id="FilteredLookup" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;SubjectCanTeach&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;Math&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;ViewFields&gt;&lt;FieldRef Name=&quot;Title&quot;/&gt;&lt;FieldRef Name=&quot;SubjectCanTeach&quot;/&gt;&lt;FieldRef Name=&quot;ID&quot;/&gt;&lt;FieldRef Name=&quot;PermMask&quot;/&gt;&lt;/ViewFields&gt;&lt;/View&gt;"><SelectParameters><asp:Parameter Name="ListID" DefaultValue="{17CFFB4F-665F-4F7F-9914-7DCE51312962}" /></SelectParameters><DeleteParameters><asp:Parameter Name="ListID" DefaultValue="{17CFFB4F-665F-4F7F-9914-7DCE51312962}" /></DeleteParameters><UpdateParameters><asp:Parameter Name="ListID" DefaultValue="{17CFFB4F-665F-4F7F-9914-7DCE51312962}" /></UpdateParameters><InsertParameters><asp:Parameter Name="ListID" DefaultValue="{17CFFB4F-665F-4F7F-9914-7DCE51312962}" /></InsertParameters></SharePoint:SPDataSource>

       

  7. Before starting this step always back up any files you will be editing. In SharePoint Designer, open the file you will be editing such as EditForm.aspx or NewForm.aspx file. This step will allow you to get to the individual list columns to edit them.
    1. Hide the existing List Form Web Part by changing the IsVisible property to false for <IsVisible>false</IsVisible> in code view.
    2. Place your cursor directly after the hidden List Form Web Part and add another List Form Web Part by clicking Insert/SharePoint Controls/ Custom List Form…

       

       

    3. Choose your list and form type. Click Ok.

       

       

  8. In the code view of your form search for the tag <DataSources>
    1. After the entry for the existing <SharePoint:SPDataSource … and before the closing </DataSources> tag, paste in the copied SPDataSource from step 6.
    2. Your code should look something like this:

       

       

     

  9. Setup your SharePoint environment to be in Split mode. In Design View select the column that will be used for the lookup field. Right now it will show as a textbox. In Code View the associated code for the textbox will be highlighted. Comment out the textbox.

     

     

  10. Add the following code right after the commented out textbox and then modify the values in bold to match your particular list:

     

    <SharePoint:DVDropDownList runat="server" id="ff5 {$Pos}" DataSourceID="FilteredLookup " DataTextField="Title " DataValueField="Title " SelectedValue="{@MathTeachers }" __designer:bind="{ddwrt:DataBind('u' ,concat('ff5' ,$Pos),'SelectedValue','SelectedIndexChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@MathTeachers' )}"/>

     

Change

Explanation

ff5

This should be the same ff# as what was commented out for the text field

@MathTeachers

See the value of text= as was commented out for the text field

FilteredLookup

The name of your lookup list datasource which is what was entered as the id (step 6)

u

u or I where u=edit mode and i= new mode

DataTextField="Title "

Change Title as necessary to match the field from the Lookup List (MyFilteredLookup)

DataValueField="Title "

Change Title as necessary to match the value from the Lookup List (MyFilteredLookup)

 

11. Those are all the steps you need.

    

  1. 12. Any time you need to update your filter (for example sorting the items or changing criteria), you can always go back into the properties of your copied datasource, make your change, save locally, copy out the select command and paste into your new datasource on the page.

借助生成式 AI 加快创作速度,通过快速构建 Omniverse 扩展程序,您可以直接在 USD Composer 中连接首选的生成式 AI 智能体并与之交互。或者,您也可以使用由 LLM 提供支持的 通过快速构建 Omniverse 扩展程序,您可以直接在 USD Composer 中连接首选的生成式 AI 智能体并与之交互。或者,您也可以使用由 LLM 提供支持的 OpenUSD 开发方法,为您的工作流程提供强劲助力。 阅读详情

相关推荐

计算文本相似度的常用算法

NLP、数据挖掘领域中,文本分析是一个很重要的领域,这有助于我们去让计算机理解语言的作用和使用。文本分析是数据挖掘的重要手段,利用文本分析,我们将很快的读取到一本书、一篇文章、一段话中的关键词和核心思想,而文本相似度就是我们用来剔除无用信息或者重复信息的重要手段,让计算机去找文本中的不同。 在生活中,信息检索、数据挖掘、机器翻译、文档复制检测等领域都应用到“文本相似度”。文本不仅仅是文字,文本相似度的应用更广,除了文字的匹配,还可以是图片、音频等,因为它们的实质都是在计算机中都是以二进制的方式存在的。相.

氧小氢的博客 2万+

SharePoint列表的人员类型字段LookUpId取值来源说明

当字段为人员或组且需要通过Graph Api来修改这个字段的值时,发现这个字段的LookUpId为int型,但AAD用户的Id为guid。可以通过获取普通SharePoint list数据的方式来获取这个列表的数据,然后可以使用这个隐藏用户列表的id来对应LookUpId了。后面找了一篇文章,发现这个LookUpId的取值来自sharepoint的一个隐藏用户列表。SharePoint列表字段可以为字符串,数字,布尔,人员或组等类型。

qq_42371986的博客 673

土地利用数据从1972到2023:如何利用Landsat和Sentinel数据构建长期变化监测模型

本文详细解析了如何利用1972至2023年的Landsat和Sentinel遥感数据构建土地利用长期变化监测模型。通过多源数据融合策略、时间序列预处理流程和深度学习算法,实现高精度的土地利用分类与变化检测,为生态评估和城市规划提供科学依据。文章还探讨了验证方法和实际应用案例,展示了长期遥感数据在环境建模中的独特价值。

weixin_28720573的博客 443

Sharepoint lookup字段的关联列表查询

Sharepoint lookup字段的关联列表查询 考虑到对lookup字段的CAML查询的模糊,在此举例验证。 1. 假设我有两个列表,薪资列表(Salary)和员工列表(Employee)。而薪资列表需要引用到员工编号,即lookup。 2. 薪资列表包含员工编号(Employee)和薪资(Salary)。 3. 员工列表包含员工编号(Employee), 员工名字(Employ

专注SharePoint 3745

【CTF-misc】java盲水印BlindWatermark工具使用

​ 盲水印是一种肉眼不可见的水印方式,对图片资源使用图片盲水印或者文字水印,借此避免数字媒体未经授权的复制和拷贝,可通过对原图进行解码操作,得到水印图来证明版权归属。 题目来源:NewStarCTF 2023 公开赛道 WEEK2|MISC:Jvav

qq_39972370的博客 6445

手把手教你用MaxEnt+ArcGIS玩转物种分布预测

本文详细介绍了如何利用MaxEnt最大熵模型与ArcGIS软件进行物种分布预测。通过实战案例,从数据收集、环境变量处理、模型参数设置到结果可视化分析,手把手教你掌握生态位模型的核心流程。结合SDM toolbox插件,可高效完成数据预处理与高级空间分析,是生态学与保护生物学研究的实用指南。

weixin_29309475的博客 559

Sharepoint学习笔记---SPList--创建一个带有Lookup字段的List

  这里我们用代码创建一个带有Lookup字段(名为: LookupStaffName)的List (名为:TestSale),它的Lookup字段从另一个名为SaleStaff的List中获取。因此,我们首先在我们的测试网站上手工创建一个List,命名为SaleStaff,并输入测试数据如下     然后使用如下代码去创建TestSale这个List string siteURL = ...

weixin_33841503的博客 279

[Dify实战] 解决 Dify 导入 DSL 文件时报 “DSL 版本差异” 的兼容性问题

摘要:本文针对Dify开发者在导入.dsl文件时遇到的版本警告提示问题,分析其根源在于DSL文件与当前系统版本不一致。解决方案是通过导出当前Dify应用的DSL文件查看版本号,手动修改待导入文件的version字段以匹配。文章详细说明了操作步骤,并给出使用专业编辑器、避免修改其他字段等实用建议,帮助开发者规避版本不兼容问题,提升多模态AI应用开发效率。

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 961

SharePoint 创建 Lookup 类型的Site Column解决跨站问题

http://www.cnblogs.com/OceanEyes/p/create-lookup-field-for-cross-site.html http://www.cnblogs.com/OceanEyes/p/create-lookup-field-for-cross-site.html

段传涛 的专栏 1031

【系统分析师】高分论文:论基于构件的软件开发(气象灾害影响评估系统)

本文以某手机气象灾害影响评估系统为例,探讨了基于构件技术的软件开发实践。通过分析开发中常见的功能模块重复问题,提出建立企业构件库、针对性选择构件和加强构件管理的解决方案。项目实施中成功复用登录模块等通用构件,并针对气象数据转换需求开发新构件,最终在8个月内高质量完成系统建设。文章总结了构件开发的三个关键点:构件库建设是基础、构件选择需精准、构件管理要规范。同时指出需注意全新需求开发、性能优化等问题,建议通过培训提升团队对构件的理解力。该案例证明构件技术能有效缩短周期、降低成本,为企业积累可复用的技术资产。

数据知道的博客 4253

杰理SDK UART 使用教程

本文介绍了JL701n芯片的UART串口通信使用教程,重点讲解了UART2的初始化配置、数据收发和中断处理功能。教程详细说明了代码结构、核心功能函数、配置参数和使用步骤,包括UART初始化、数据发送和接收中断处理等关键操作。同时提供了完整的API接口说明和注意事项,强调了中断处理限制、缓冲区管理、引脚配置等重要细节。最后给出了基本使用流程和高级任务处理示例,并针对常见问题提供了故障排除建议。本教程适用于需要在JL701n芯片上实现可靠串口通信的开发者。

qq_42014563的博客 1817

在SharePoint中使用关联列表(Related List)

使用关联列表(related list)

shrenk的专栏 4125

GEO的工作原理,以及GEO会催生出更多的爬虫岗位吗?

摘要: GEO(生成式引擎优化)是提升内容在AI搜索(如ChatGPT、Perplexity等)中引用率的新策略,核心在于优化内容的可抓取性、语义清晰度、权威性。与传统SEO不同,GEO聚焦AI的引用逻辑,需通过爬虫监控AI回答、逆向分析引用源特征(如结构化数据、权威背书),并构建自动化工具优化内容。爬虫工程师需转型为“AI可见性基础设施构建者”,重点关注高权威站点、知识库及官方信息源,同时确保技术可抓取性(如放行AI爬虫UA)。GEO的核心是从“排名”转向“被AI引用”,强调实体识别与动态对话适配。

数据知道的博客 4640

【Sharepoint】使用SharePoint rest api对list中的数据进行获取、排序、筛选、分页操作

获取数据 1、获取所有数据(所有字段) https://weburl/_api/web/lists/getbytitle('infolist')/items 2、获取指定字段 可以通过select来指定需要获取的字段:$select=Field1, Field2, Field3 https://weburl/_api/web/lists/getbytitle('infolist')/items?$select=ID,Title,Employee,company 排序操作 可以通过..

光影8号的专栏 2018

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Sharepoint 2010 新特性笔记

Training summary Session 1 - Visual Studio 2010 Tools for SharePoint 2010 l VS2010集成了Sharepoint Manager(Sharepoint Explorer) l VS2010集成了WSPBuilder(在vs2010中可以新建sharepoint项目右击项目可以将新功能直接部署到sharep...

weixin_30567225的博客 247

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

SharePoint list lookup column indexing and CAML query relation

I’m developing the SharePoint site with so many lists. First I didn’t consider the indexing of the columns of lists. But as the lists are going to have large number of items the performance is decrea...

iteye_15884的博客 276

sharepoint之lookup字段

买个关子,明天再写。这个东西网络上面的资料不多。我是纯粹通过配置文件实现的。 买个关子,明天再写。这个东西网络上面的资料不多。我是纯粹通过配置文件实现的。 里面有三个lookup字段,然后将要关联的list的guid放在list字段中就可以了。 继续以前的。下载微软的 Visual Studio 2008 extensions for Windows SharePoint Ser...

weixin_30925411的博客 435

sharepoint中筛选的使用

我们知道列表可以方便的显示数据,可以对同一个列表建立多个视图,在视图中决定要显示哪些字段等 如果想更方便的控制显示,可以在sharepoint designer中把这个视图转成数据视图,可以根据页面参数来进行筛选: 例如 http://xxx/page.aspx?name=xx&amp;email=xx, 这里, 我们想获取name和email的value. 用sharepoint d...

weixin_33922670的博客 334

SharePoint 2003 用REST方式访问列表 Filter等高级操作。

首先为了方便在chrome 里调试Rest 结果。这里先介绍如URL https://xxx.xxx.com.cn/itc/_api/web/GetFolderByServerRelativeUrl('JSdocs')/files?$filter=Title%20eq%20%27test%27 说明:使用这个句子: https://xxx.xxx.com.cn/itc/_api/web/G

段传涛 的专栏 2952

SharePoint—用REST方式访问列表

REST的定义与作用 在SharePoint 2010中,基本上有如下几种数据访问方式: 服务器端对象模型 LINQ to SharePoint Web Service 客户端对象模型 ADO.NET Data Service (REST协议)...

weixin_33836874的博客 236

SharePoint 设置Lookup 字段的值

如何设置Lookup字段的值,首先我们同样需要了解SPFieldLookupValueCollection和SPFieldLookupValue,这2个类的原理和之前所讲解到SPFieldUserValueCollection一样,这里就不多讲解 1 /// <summary> 2 /// Convert dropdownList val...

weixin_34240657的博客 352

SharePoint 2013 Step by Step——How to Create a Lookup Column to Another Site(Cross Site)

OverView In this post,I want to show u how to add a look up column in my list or library that looks up data which comes from a list or library of another site. I have to say,it is a awesome Function...

weixin_34061482的博客 161

SharePoint 获取Lookup 字段的值

获取某个List里的Lookup字段的值是很普遍的事,那么我们将它封装起来 获取Lookup字段值的方法: 1 /// <summary> 2 /// To get lookup field Id or Value 3 /// </summary> 4 /// <typeparam ...

weixin_34310127的博客 300

sharepoint列表关联

<br />   今个来晒晒sharepoint一些小知识,本人新手,请多指教哈<br />    sharepoint的强大功能就不用我多说了,在这想说说不用编程的方法,使俩个列表值相关联。看了网上的好多方法,都是使用designer 来创建一个dataview,然后利用多视图创建关联表,但是这样是关联起来了,也不会出错,就是会多出现一个table,使得关联的列表项还像个子表似的,不太美观。我是跟前辈学的,哇哈哈,利用xpath语句添加相关项。<br />                       <b

hxwoniu的专栏 1511

SELECT *对比SELECT COLUMNS查询分析

参考: https://use-the-index-luke.com/blog/2013-08/its-not-about-the-star-stupid https://weblogs.asp.net/jongalloway/the-real-reason-select-queries-are-bad-index-coverage

jfcat的专栏 1218
上一篇: 在Sharepoint 2010中 启用 构建动态字符串 活动
下一篇: Adding Custom Actions to the List Item Menu in SharePoint 2010 Using SharePoint Designer 2010[Sharepoint中添加自定义菜单]
SseJava
博客等级 码龄23年 7粉丝 9原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值