博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Filter a View by “Me” Without a People Column
阅读量:5806 次
发布时间:2019-06-18

本文共 2707 字,大约阅读时间需要 9 分钟。

This applies to the Enterprise version only, for SharePoint 2007 or 2010.

A lot of times, especially with InfoPath fields, you end up with a text field with a user’s name in it, instead of an actual people picker field.  The syntax may be something like DOMAIN\username.  In this post, I’ll use the example of “Current Approver”. This text field is not very useful, though, when trying to create a filtered view where that text field (Current Approver) is equal to [Me], the logged in user.  Sometimes if I’ve got a text field with a name in it and want users to be able to see a view of their own items, I’ll even create a new people field in the list, and create a workflow that copies the name value over from the text field to the people picker.  This gives a nice, pretty people field, and gives you the ability to filter by Current Approver is equal to [Me].

In this post, I’ll show you a quick way to show users a view of items applicable to “Me”, without having to go to the trouble of creating an extra people picker field just to be able to use [Me].

ch5[158]

Here’s the example list, and you see the “Current Approver” column is just a text field.  The next step is to filter this view so that the logged in user only sees items with their own name as the current approver.

  1. Click <Site Actions>, and choose <Edit Page>
  2. Click to Add a New Web Part, and add the Current User Filter web part to the page.
    ch5[159]
  3. Take a look at the current user filter web part settings in the web part toolpane.  You’ll notice that by default, the value that is stored in this web part is the current users' DOMAIN\username.  There is also a drop-down box where you can pick the user’s email address, department, etc.  I’m going to leave the default.
    ch5[161]
  4. Create a web part connection from the Current User Filter web part.  Choose to Send Filter values to, and then choose the consumer web part, which is the SharePoint list you want to filter.
    ch5[162]
  5. Pick the “Current Approver” or whatever field contains your user names, and click Finish, and exit edit mode.
    ch5[163]
  6. This is what the final, filtered view looks like:
    ch5[164]

In SharePoint 2010, you can safely remove the “Current Approver” column from the view if you don’t need to see it.  In SharePoint 2007, it won’t allow you to create a connection to a column that isn’t displayed in the view (unless the view is a data view web part).  Remember that this same thing can be done with other types of user name syntax, like the email address or full name.  Done!

If you’d like to learn more about how you can test to see what values are being passed from the Current User Filter web part, read my post:

转载于:https://www.cnblogs.com/ahghy/archive/2013/05/09/3068322.html

你可能感兴趣的文章
Java 机试题:解析命令行参数
查看>>
Flash Message For Laravel5
查看>>
Laravel 5 error SQLSTATE[HY000] [1045]
查看>>
与多说评论说再见
查看>>
通过爬虫快速获取可用代理IP
查看>>
原生APP开发,领先一步商机
查看>>
webpack 大法好 ---- what`s webpack?(前言)
查看>>
杠上Spark、Flink?Kafka为何转型流数据平台
查看>>
小程序·云服务的系统架构和运维实现
查看>>
安全狗:云时代的服务器安全守护者
查看>>
持续交付——不仅仅是技术
查看>>
RPC协议之争和选型要点
查看>>
Uber开源TensorFlow框架工具箱Ludwig,无需编码即可进行深度学习开发
查看>>
极限编程创始人Ron Jeffries建议开发者放弃敏捷
查看>>
Facebook开源工具包LASER,支持93种语言
查看>>
用Kanban-Ace框架改进Scrum
查看>>
InfoQ播客: Shuman Ghosemajumder谈安全和网络犯罪
查看>>
如何利用PostgreSQL的延迟复制实现灾备
查看>>
国内AI企业深网视界数据库未加密,200多万条敏感个人信息“裸奔”
查看>>
LinkedIn开源Photon机器学习:支持Spark
查看>>