Forum Discussion
Chris_Clark1968
Feb 08, 2023Brass Contributor
Archive records from a list which as exceed the 5k limit
Hi,
A SharePoint list as exceed it 5k limit.
As anyone be able to archive data to another list, using a Flow?
Is it possible to archive files in to individual folders for example for the years the files relate to?
- SvenSieverdingBronze Contributor
Hi Chris_Clark1968,
the 5000 item limit just means that you can not query more than 5000 items in one batch.
If you have indexed metadata columns that allows you to limit the total amount of items a single query returns to below than 5000, you can query the items.
If you have a date column that is indexed (Gear->List Settings->Scroll down to "Indexed Columns") then you could use that column to limit your query to i.e. all items from 2023 (and hope that that are not more than 5000 items).
I personally would limit the items using the ID column.... So first query all items where the ID is between 1 and 4999 and copying each one of them into an new list... then take all items with IDs between 5000 and 9999....until there are no more items.
If you then want to re-organize your files into folders then you can just copy the files to a new folder path that contains the years.
Best Regards,
Sven- Chris_Clark1968Brass Contributor
SvenSieverding
The issue is relating to a Choice column in the list. Trying to add to the list and this error message appearsThere are loads of records. Over 20k
- SvenSieverdingBronze Contributor
Hi Chris_Clark1968,
are you setting the toggle "Enforce Unique Values" (in "More Options") to true?
(Do you really want that with a choice column? Then you can only use each choice exactly with one element)
This combination won't work in a list with more than 5000 elements as SharePoint can not make sure that this setting works.
Best Regards,
Sven