Hi @zennis,
Firstly, we cannot create views with a .csv file in SharePoint Online. As a workaround, I suggest you create views using the below PnP PowerShell script.
#Config Variables
$SiteURL = "https://xxx.sharepoint.com"
$ListName= "Projects"
$ViewName= "Active Projects"
$ViewFields = @("ProjectID", "Title","Category","ProjectStatus")
$Query = "<Where><Eq><FieldRef Name = 'ProjectStatus' /><Value Type = 'Choice'>Active</Value></Eq></Where>"
#Get Credentials to connect
$Cred = Get-Credential
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#sharepoint online pnp powershell create view
Add-PnPView -List $ListName -Title $ViewName -ViewType Html -Fields $ViewFields -Query $Query -ErrorAction Stop
Write-host "View '$ViewName' Created Successfully!" -f Green
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red }
Additionally, The Add-PnPView cmdlet supports -RowLimit, -SetAsDefault switches. You can also use the Query parameter to set sorting or group by. E.g.,
- Sort Order: “<OrderBy> <FieldRef Name= ‘Modified’ Ascending=’false’ /> </OrderBy>”
- Group By: “<GroupBy><FieldRef Name = ‘Status’ /></GroupBy>”
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.