- Create public view to exclude list item based on the column value.
- Create another master view to display all items.
- Add a page that is only be accessed by Admin group that has the link to the master view and include the master view.
- Use Powershell to hide the view from view selections.
#Install-Module SharePointPnPPowerShellOnline
#Change this to the URL of your SharePoint site
$sharePointUrl = "https://yourcompany.sharepoint.com/sites/sitename"
#Connect-PnPOnline –Url $sharePointUrl –Credentials (Get-Credential)
# open learner list
$listUrl = "Lists/listname"
$list = Get-PnPList -Identity $listUrl
$list.Context.Load($list.Views)
$list.Context.ExecuteQuery()
ForEach($v in $list.Views){
if($v.Title -eq 'ListViewName'){
$v.Hidden = $true;
#$v.Hidden = $false;
$v.Update()
}
}
$list.Context.ExecuteQuery()
No comments:
Post a Comment