Forum Discussion

Oskar Kuus's avatar
Oskar Kuus
Iron Contributor
Jul 02, 2021

Delete data from sharepoint list

I have a SP list with about 40k rows. I need to clean this and delete old rows.

But I can not find an good way to delete large amounts.
I basically can only work with 100-200 posts at a time and it lags very much.

Can I sync it to excel and then update it to SP?

Other solutions?

1 Reply

  • KrunalRohit's avatar
    KrunalRohit
    Brass Contributor

    Oskar Kuus I believe PowerShell is your savior. You can use it in any way you want to fulfill your needs.

     

    Delete a single item: 

    https://www.sharepointdiary.com/2016/01/sharepoint-online-delete-list-item-using-powershell.html

     

    Delete multiple items:

    https://www.sharepointdiary.com/2015/10/delete-all-list-items-in-sharepoint-online-using-powershell.html 

    https://social.technet.microsoft.com/wiki/contents/articles/17895.powershell-script-to-delete-items-from-sharepoint-list.aspx 

     

    Just a thought - You can create a view based off the certain condition (e.g. SP view for older items), and delete the items manually by selecting all.

     

    Hope it helps.

Resources