How to Filtering data using rest API which is fetched from Document library in SharePoint  

  RSS

TopicCreator
(@topiccreator)
Eminent Member Moderator
Joined: 1 year ago
Posts: 12
04/07/2018 3:15 pm  

Hi

I able to fetch the documents that are uploaded into the document library of SharePoint online. Now I want to filter the contents that are fetching based on a Lookup column and Choice column. But filtering is not working in rest API. What Can i do?

So Please,Can anyone help me?

Below is the part of the url which I am using.

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


ReplyQuote
TechGroup Admin
(@admin)
Eminent Member Admin
Joined: 1 year ago
Posts: 11
04/07/2018 3:36 pm  

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

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText&$expand=FieldValuesAsText&$Filter=
FileLeafRef eq 'Data.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 "Lookup1" and choice field is "Choice1".

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

ReplyQuote
Share:
  
Working

Please Login or Register