When using JavaScript in SharePoint and dealing with items/rows of data from a few hundred to thousands, what is the best and most efficient and fastest way to work with the data? Should it be dumped in an array and worked with that way or .......?

How do you SharePoint developers or even database developers programmatically handle thousand of rows/items of data?

I usually use JSOM, spServices or REST API to connect to my lists to grab data.

Thanks for any insight.

  • paging or row limit is the best way to work. – Anil Pal Dec 9 '16 at 15:09

Below are some recommendation/views for working with List data in thousands

  1. SharePoint List can hold millions of records, it does not limit as such(don't have exact count).
  2. To avoid performance issue, they have enforce threshold value of 5000(can be changed from central admin/powershell) for querying list items one at time.
  3. This threshold limit is for querying data, it means your caml query should not return items more than 5000 in single query.
  4. You should design your list/pages so that display data based on filters applied on column/s.
  5. Columns used in filters should be indexed, index can only be created before list reach threshold limts.
  6. If you have multiple filters in your caml query, make sure first column passed in filter does not return more than 5000.

As you would be using client side code, it is always recommended to get data only which are required to display on initial page load. Do not get all data as it does not make sense that you display 1000 of records, user anyway is not going to see all the data at once. you can query your data in batch and apply pagination. This will make sure you are querying minimum data and page does not have overhead to process unnecessary data and render on page.

Provide some filters for users to select so that you can use this filters to get only required data. This will totally depend on your business use case.

You can also dump our data into json object for processing, there are some pre-defined funcitons available which can convert spservices response to json. Try to avoid looping through 1000 of records, though client side it would be faster but still it is a overhad.

Hope this helps...

  • Let's say I have 8,000 items in my SharePoint list and all I want to do is create some type of dashboard that visualizes the data in different way as in pie, bar, line charts, etc. Sometimes, the page can load a little slow depending on the number of items that's being calculated in building the chart. Any recommendations or suggestions? – JustMe Dec 9 '16 at 19:52

You should only bring the data you need from the server. If you have 10,000 items in the list and you will show the user 10 items in the homepage, then don't retrieve more than 10 items. Once the user clicks Next>, you can then get the next 10 items. Maybe the user won't be interested in seeing more than the 10 items in the homepage!

You can achieve this using JSOM and REST.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.