想要在sharepoint list people列中检查当前用户是否存在 [英] Want to check current user exist or not in sharepoint list people column

查看:81
本文介绍了想要在sharepoint list people列中检查当前用户是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts, 



我有一个共享点列表,其中包含人员列,我将一些用户存储在此柱。我想在此列中检查当前用户是否存在。为了实现这个目的,我在URL下面尝试了。但我很困惑,因为当我从人员栏中获取用户
时,我会得到不同的ID。当我检查当前用户时,我得到不同的ID。所以我怎样才能做到这一点。


请帮忙!


注意:   我已经将当前用户存储在人员列中。



获取当前使用的用户ID :   / _ api / web / currentuser?$ select = Title,Email,Id




通过上面的网址我得到大号的id。




要检查人员中的用户列:   / _ api / web / lists / getbytitle('AllUsers')/ items?$ select = ICTMHead / Name,ICTMHead / ID& $ expand = ICTMHead / Id";  



问题:两个Rest网址都给出了不同的ID,所以如何检查用户是否存在。


解决方案


此问题仅发生对于"contoso\administrator"(系统帐户) 用户,您可以检查其他用户,您将获得相同的用户ID。


为避免此问题,我们可以使用下面的REST API获取当前用户登录名,然后使用"ICTMHead / Name"检查人员列中的用户。

 / _ api / web / currentuser?


select = LoginName

最好的问候,


丹尼斯


Hello Experts, 

I have one sharepoint list, which has people column and i store some user in this column. i want to check current user exist or not in this column. to achieve this thing i have try below URL's. but i am very confused because when i get user from people column i get different ID. and when i check for current user i get different ID. so how can i achieve this.

Please Help!

Note:  I already store current user in people column.

To get current user ID i used :  /_api/web/currentuser?$select=Title,Email,Id

through above URL i get id in large Number.

To Check user in people column is used:  /_api/web/lists/getbytitle('AllUsers')/items?$select=ICTMHead/Name,ICTMHead/ID&$expand=ICTMHead/Id";  

Issue: Both Rest URL's give different ID, so how can i check user exists or not.

解决方案

Hi,

This issue only occurs for the "contoso\administrator"(system account) user, you can check other users, you will get the same User ID.

To avoid this issue, we can use the REST API below to get the current user login name, then check user in people column using "ICTMHead/Name".

/_api/web/currentuser?


select=LoginName

Best Regards,

Dennis


这篇关于想要在sharepoint list people列中检查当前用户是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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