pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
740 stars 300 forks source link

Get All method is missing in the version 4 #3078

Closed thahirvly closed 5 days ago

thahirvly commented 5 days ago

What version of PnPjs library you are using

4.x

Minor Version Number

4.2.0

Target environment

SharePoint Framework

Additional environment details

React app hosed in SharePoint site

Question/Request

Hi, SP -> List Items -> Get All items option is missing in the latest version. Please let me know how to retrieve all items using a single request.

patrick-rodgers commented 5 days ago

Get all never executed a single request, it just hid the paging for you. Now that we support the async iterator pattern, paging is much simpler, and you can use a loop to gather all the items. If this is something you do often, easy enough to create a helper function.

I would, as always, point out there is often little reason to get all the items in a list for a client application. Better if you can just show the last 5 articles or similar.

thahirvly commented 5 days ago

Get all never executed a single request, it just hid the paging for you. Now that we support the async iterator pattern, paging is much simpler, and you can use a loop to gather all the items. If this is something you do often, easy enough to create a helper function.

I would, as always, point out there is often little reason to get all the items in a list for a client application. Better if you can just show the last 5 articles or similar.

Thank you for the suggestion. It looks like, Async Paging link is not working in the page. It should redirect to Async Paging I believe.

juliemturner commented 5 days ago

I'm going to close this issue as answered. If you have further issues, please feel free to create a new issue and reference this one.

github-actions[bot] commented 3 days ago

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.