PnP-PowerShell
PnP-PowerShell copied to clipboard
Clear-PnPDefaultColumnValues : Object reference not set to an instance of an object.
Reporting an Issue or Missing Feature
Issue
Clear-PnPDefaultColumnValues not working with managed metadata field.
Expected behavior
I am able to Set-PnPDefaultColumnValues without an issue. But when I try to Clear-PnPDefaultColumnValues I receive the below error. The field in this case is a Managed Metadata field
Actual behavior
Clear-PnPDefaultColumnValues -List "DL1" -Folder "/Hello" -Field "Topic"
Clear-PnPDefaultColumnValues : Object reference not set to an instance of an object.
At line:1 char:1
+ Clear-PnPDefaultColumnValues -List "DL1" -Folder "/Hello" -Field "Top ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Clear-PnPDefaultColumnValues], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Lists.ClearDefaultColumnValues
Steps to reproduce behavior
Set-PnPDefaultColumnValues -List "DL1" -Folder "/Hello" -Field "Topic" -Value "62fe7219-0ec3-42ac-96"
Clear-PnPDefaultColumnValues -List "DL1" -Folder "/Hello" -Field "Topic"
Clear-PnPDefaultColumnValues : Object reference not set to an instance of an object.
At line:1 char:1
+ Clear-PnPDefaultColumnValues -List "DL1" -Folder "/Hello" -Field "Top ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Clear-PnPDefaultColumnValues], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Lists.ClearDefaultColumnValues
Get-PnPException
Message : Object reference not set to an instance of an object.
Stacktrace : at Microsoft.SharePoint.Client.ListExtensions.<>c__DisplayClass72_1.<ClearDefaultColumnValues>b__
6(IDefaultColumnValue c)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.SharePoint.Client.ListExtensions.ClearDefaultColumnValues(List list, IEnumerable`1
columnValues)
at SharePointPnP.PowerShell.Commands.Lists.ClearDefaultColumnValues.ExecuteCmdlet()
at SharePointPnP.PowerShell.Commands.PnPCmdlet.ProcessRecord()
ScriptLineNumber : 1
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [x] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
SharePointPnPPowerShellOnline 3.7.1903.0
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [x] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Any workarounds or fix?
@jonikkrusesmith nothing as of yet...is it the same for you?
Any news on this?
We are also looking for an update on this - any news?
Today I encountered the same issue. Any news?
Had the same issue today.