简体   繁体   English

使用C#CSOM检查SharePoint 2013文档库中的DocumentSet是否存在

[英]Check DocumentSet exist in SharePoint 2013 Document Library using C# CSOM

I've a requirement to check whether a documentset exists in Sharepoint 2013 Document Library. 我需要检查Sharepoint 2013文档库中是否存在文档集。

I have a Document Library, it has a folder, and inside the folder there are a few DocumentSets, however I need to check whether a particular documentset exists by passing it a Title. 我有一个文档库,它有一个文件夹,并且在文件夹中有一些DocumentSet,但是我需要通过传递一个Title来检查特定的文档集是否存在。

Url will looks like: /Library/Folder/Documentset_name 网址看起来像:/ Library / Folder / Documentset_name

Can anybody offer a reference/solution for this? 有人可以为此提供参考/解决方案吗?

Thanks in advance!! 提前致谢!!

You can use the SharePoint Api to achieve this. 您可以使用SharePoint Api实现此目的。

Look at Api documentation . 查看Api文档

You will get all files with metadata in json format with 您将使用json格式获取所有带有元数据的文件

http:///_api/web/getfolderbyserverrelativeurl('/')/files HTTP:/// _ API /网络/ getfolderbyserverrelativeurl( '/')/文件

After that you can check if the response contains your filename. 之后,您可以检查响应中是否包含您的文件名。


An even better solution is to use the filter function in the request. 更好的解决方案是在请求中使用过滤器功能。

See this reference for more information. 有关更多信息,请参见此参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM