Hi @sns ,
As for exporting the list to csv, because the number of items exceeds the threshold, it cannot be done directly through the UI interface. It is recommended that you use powershell to export.
Run the following code:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Set config variables
$WebURL="https://projects.crescent.com"
$ListName ="Projects"
$OutPutFile = "C:\temp\Report.csv"
#Delete the Output File if exists
If (Test-Path $OutPutFile) { Remove-Item $OutPutFile }
#Get Web and List Objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]
Write-host "Total Number of Items Found:"$List.Itemcount
#Define the CAML Query
$BatchSize = 500
$Query = New-Object Microsoft.SharePoint.SPQuery
$Query.ViewXml = @"
<View Scope='Recursive'>
<Query>
<OrderBy><FieldRef Name='ID' Ascending='TRUE'/></OrderBy>
</Query>
<RowLimit Paged='TRUE'>$BatchSize</RowLimit>
</View>
"@
$Counter = 0
#Process items in batch
Do
{
#Get List Items
$ListItems = $List.GetItems($Query)
$Counter = $Counter+$ListItems.Count
Write-Progress -PercentComplete ($Counter / ($List.ItemCount) * 100) -Activity "Exporting List Items of '$($List.Title)'" -Status "Processing Items $Counter of $($List.ItemCount)"
#Array to Hold Result - PSObjects
$ListItemCollection = @()
#Get All List items
$ListItems | ForEach {
#write-host "Processing Item ID:"$_["ID"]
$ExportItem = New-Object PSObject
#Get Each field - Exclude hidden
Foreach($Field in $_.Fields | Where {!$_.hidden})
{
$ExportItem | Add-Member -MemberType NoteProperty -name $Field.InternalName -value $_[$Field.InternalName]
}
#Add the object with property to an Array
$ListItemCollection += $ExportItem
}
#Export the result Array to CSV file
$ListItemCollection | Export-CSV $OutPutFile -NoTypeInformation -append
$Query.ListItemCollectionPosition = $ListItems.ListItemCollectionPosition
}
While($Query.ListItemCollectionPosition -ne $null)
Write-host "List data exported to CSV Successfully!" -f Green
Regarding adding indexes, you can follow the steps below to add indexes according to your actual situation.
Go to list settings-->column (section)-->Indexed columns-->Create a new index.
- To create a simple index, select a column that is not a Lookup column in the Primary Column section, under Primary column for this index.
- To create a compound index, select a lookup column as the primary column for this index. Use a different column that is not a Lookup column in the Secondary Column section, under Secondary column for this index.
- Notes:
- Be sure to select a supported column to index
- If you are adding an index to avoid a List View Threshold error, ensure that the field used is not a lookup field. Please see supported column to determine which field types are lookup fields.
For more information, please refer to:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.