You could pull items from a specific view instead of entire list through PNP PowerShell.
Here are steps:
1.Grant access by using SharePoint App-Only.
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
2.Run following PNP PowerShell.
#Config Parameter
$SiteURL = "https://tenant.sharepoint.com/sites/AmyTeam"
$ClientID = "ClientID"
$ListName = "listname"
$ViewName= "viewname"
$SelectedFields = @("ID","Title","test") #InternalName of the selected fields
$CSVPath = "C:\ListData.csv"
$ListDataCollection= @()
#Connect to SharePoint Online site
Connect-PnPOnline -Url $SiteURL -Interactive -ClientId $ClientID
$Counter = 0
$List = Get-PnPList -Identity $ListName
$ListView = Get-PnPView -List $ListName -Identity $ViewName -Includes ListViewXml
$ListItems = Get-PnPListItem -List $ListName -Query $ListView.ListViewXml
$ListItems | ForEach-Object {
$ListItem = Get-PnPProperty -ClientObject $_ -Property FieldValuesAsText
$ListRow = New-Object PSObject
$Counter++
ForEach($Field in $SelectedFields)
{
$ListRow | Add-Member -MemberType NoteProperty $Field $ListItem[$Field]
}
Write-Progress -PercentComplete ($Counter / $($ListItems.Count) * 100) -Activity "Exporting List Items..." -Status "Exporting Item $Counter of $($ListItems.Count)"
$ListDataCollection += $ListRow
}
#Export the result Array to CSV file
$ListDataCollection | Export-CSV $CSVPath -NoTypeInformation
3.Result:
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.