1

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.

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

2 Answers 2

1

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 '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".

/_api/web/lists/getbytitle('DL')/items?$select=*,FieldValuesAsText,MyLookup/Title&$expand=MyLookup&$Filter=MyChoice eq 'Choice1' and MyLookup/Title eq 'lookup1'
Sign up to request clarification or add additional context in comments.

Comments

0

you can try this one:

/_api/web/Lists('ListGUID')/items?$select=FieldValuesAsText/FileRef&$expand=FieldValuesAsText&$filter=FileLeafRef eq 'filename.txt'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.