My DataTable is only showing the first 100 records of the SharePoint Filtered List

My DataTable is only showing the first 100 records of the SharePoint Filtered List

TroyHannonTroyHannon Posts: 2Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I have an SPFx Web Part (in typescript) using datatables.net 1.10.16 and it will only show the first 100 filtered records of the SharePoint Online list. I have been searching for this issue and/or resolution and have not found anything. Should it by default be showing my all the filtered records? I am not using any options in my call:

let tblMyDemo = $("#tblDemo");
let dtMyDemo = tblMyDemo.DataTable();

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,150Questions: 26Answers: 4,736
    Answer ✓

    If you comment out let dtMyDemo = tblMyDemo.DataTable(); what does the HTML table show?

    I would start be verifying how many rows are provided by the SharePoint Online list. If more than 100 then we will need more information to help debug. The best thing is to post a link to your page or a test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • TroyHannonTroyHannon Posts: 2Questions: 1Answers: 0

    Yes, I eventually discovered that it was PnP and not Datatables.net I replaced my get with a getAll and it fixed my issue. thx!

  • LenfantLenfant Posts: 12Questions: 2Answers: 0

    @TroyHannon , I've got the same problem. I'm using the SharePoint api getbytitle to source my data from a SharePoint list and it is only retrieving the first 100 rows. Can you please elaborate on how you managed to get around this?

  • kthorngrenkthorngren Posts: 20,150Questions: 26Answers: 4,736

    @Lenfant I'm not familiar with Sharepoint but it looks like the default returned limit is 100. See this thread. Please look at the Sharepoint docs and support for their API usage.

    Kevin

  • LenfantLenfant Posts: 12Questions: 2Answers: 0

    @kthorngren, thanks. I got around this by appending '&$top=5000' to the end of my url. My data source rows are in the 100s and not 1000s so there is minimal performance impact.

Sign In or Register to comment.