1

It seems that I have a a lot of duplicated records in my " central " area so I wanted to either filter by Area then delete the duplicates if there is a way to do that or bulk delete every record that is "Central" in the Area column.. is that possible?

2

You can use PowerShell for doing this

$site = new-object Microsoft.SharePoint.SPSite("http://sitecollectionURL") 
$web = $site.rootweb 
$list = $web.Lists["Name of the List"]

$caml='<Where>
        <Contains>
            <FieldRef Name="Area" />
            <Value Type="Text">Central</Value>
        </Contains>
    </Where>'

$query=new-object Microsoft.SharePoint.SPQuery 
$query.Query=$caml | Write-Output

$items=$list.GetItems($query) 
$listItemsTotal = $items.Count;

for($x=$listItemsTotal-1;$x -ge 0; $x--)
{
        $items[$x].Delete()
}

$web.Dispose() 
$site.Dispose() 

Another option is to use the view itself. First filter the list items, then select the items to delete using the (tick) option. Then click on delete from ribbon.

enter image description here

  • how would I do this I never used powershell. – Matt Ludwig Mar 30 '15 at 13:41
  • You can save this as a PS1 file into your sharepoint server. Then open SharePoint Management Shell. Run that PS1 file by typing the full path. You should change the site collection URL, list name as well as the Area column name.. Also I updated answer on how to do this using the UI. – Amal Hashim Mar 30 '15 at 13:44
  • AMAL, the highest access I have to this sharepoint site is Site Collection Administration ... I don't have access to the server. Will the powershell option not work for me then??? – Matt Ludwig Mar 30 '15 at 13:49
  • Also, the 2nd option I was thinking about that but there is 15000 records I need to delete and it is only allowing me to choose 100 at a time.. is there a way around that? – Matt Ludwig Mar 30 '15 at 13:53
  • Probably you can export to excel, then make the changes and sync it back. – Amal Hashim Mar 30 '15 at 13:55

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.