使用从SharePoint中的文档库中获取的rest api过滤数据

时间:2021-05-25 15:17:36

I am able to fetch the documents that are uploaded into the document library of SharePoint online. Now I want to filter the contents that are getting fetched based on a Lookup column and Choice column. But filter is not working in rest api. Can anyone help here? Below is the part of the url I am using.

我可以在线获取上传到SharePoint文档库的文档。现在我想基于Lookup列和Choice列过滤获取的内容。但是过滤器在休息api中不起作用。有人可以帮忙吗?以下是我正在使用的网址的一部分。

/items?$select=,FieldValuesAsText/FileRef&$expand=FieldValuesAsText&$
                                              filter=FieldValuesAsText eq ‘Workbook.xlsx'",

1 个解决方案

#1


0  

If you want to filter data by file name, we can use the rest api below.

如果您想按文件名过滤数据,我们可以使用下面的其余api。

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText&$expand=FieldValuesAsText&$Filter=FileLeafRef eq 'Workbook.xlsx'

If you want to filter data base on lookup field and choice file, we can use this. In my test, the lookup field is "MyLookup" and choice field is "MyChoice".

如果要根据查找字段和选择文件过滤数据,我们可以使用它。在我的测试中,查找字段是“MyLookup”,选择字段是“MyChoice”。

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText,MyLookup/Title&$expand=MyLookup&$Filter=MyChoice eq 'Choice1' and MyLookup/Title eq 'lookup1'

#1


0  

If you want to filter data by file name, we can use the rest api below.

如果您想按文件名过滤数据,我们可以使用下面的其余api。

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText&$expand=FieldValuesAsText&$Filter=FileLeafRef eq 'Workbook.xlsx'

If you want to filter data base on lookup field and choice file, we can use this. In my test, the lookup field is "MyLookup" and choice field is "MyChoice".

如果要根据查找字段和选择文件过滤数据,我们可以使用它。在我的测试中,查找字段是“MyLookup”,选择字段是“MyChoice”。

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText,MyLookup/Title&$expand=MyLookup&$Filter=MyChoice eq 'Choice1' and MyLookup/Title eq 'lookup1'