1

I am working on a new web part to display a list of files in a SharePoint document library called Medicine files. I want users to be able to filter the files based on different columns, including file names. I am using PnPjs to search for files by name, and it works perfectly for other columns, but not for the file name. Here's my current code:

 await sp.web.lists.getByTitle("Medicine files").items.filter("FileLeafRef eq 'test.pdf'").expand("File").orderBy("Created", asc)();

When I use the Name column, I get the following error:

Column 'Name' does not exist. It may have been deleted by another user.

And when I use the FileLeafRef property, I get this error:

The attempted operation is prohibited because it exceeds the list view threshold.

I have tried different column names, such as Name, DisplayName, FileLeafRef, LinkFilenameNoMenu, LinkFilename, and BaseName without success. I have also checked the column name in the column settings, and it is defined as Name.

Any suggestions to help me resolve this issue would be greatly appreciated!

1
  • Have you tried the Graph SDK? Commented Apr 25, 2023 at 2:54

1 Answer 1

0

It seems you have more than 5000 items in list. if this is the case then you can only filter items by indexed columns.

Sign up to request clarification or add additional context in comments.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review

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.