Add-PnPDataRowsToProvisioningTemplate : Object reference not set to an instance of an object

%3CLINGO-SUB%20id%3D%22lingo-sub-85131%22%20slang%3D%22en-US%22%3EAdd-PnPDataRowsToProvisioningTemplate%20%3A%20Object%20reference%20not%20set%20to%20an%20instance%20of%20an%20object%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-85131%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20been%20trying%20to%20extract%20data%20using%20the%20new%20PnP%20command%3C%2FP%3E%3CP%3EAdd-PnPDataRowsToProvisioningTemplate%3C%2FP%3E%3CP%3EBut%20I%20am%20getting%20a%20null%20reference%20exception%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EAdd-PnPDataRowsToProvisioningTemplate%20%3A%20Object%20reference%20not%20set%20to%20an%20instance%20of%20an%20object.%0AAt%20line%3A1%20char%3A1%0A%2B%20Add-PnPDataRowsToProvisioningTemplate%20-Path%20PathToFile%20...%0A%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%2B%20CategoryInfo%20%3A%20WriteError%3A%20(%3A)%20%5BAdd-PnPDataRowsToProvisioningTemplate%5D%2C%20NullReferenceException%0A%2B%20FullyQualifiedErrorId%20%3A%20EXCEPTION%2CSharePointPnP.PowerShell.Commands.Provisioning.AddDataRowsToProvisioningTemplate%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20does%20not%20give%20any%20useful%20information.%3CBR%20%2F%3EHere%20is%20what%20I%20tried%20with%20always%20the%20same%20result%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20http%3A%2F%2FsharepointSite%0AAdd-PnPDataRowsToProvisioningTemplate%20-Path%20PathToExistingFile%0A-List%20Lists%2FSimpleEmailTemplates%20-Query%20'%26lt%3BView%26gt%3B%26lt%3B%2FView%26gt%3B'%20-Fields%20'Title'%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3EOr%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20http%3A%2F%2FsharepointSite%0AAdd-PnPDataRowsToProvisioningTemplate%20-Path%20PathToExistingFile%0A-List%20SimpleEmailTemplates%20-Query%20'%26lt%3BView%26gt%3B%26lt%3B%2FView%26gt%3B'%20-Fields%20'Title'%3C%2FPRE%3E%3CP%3EOr%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20http%3A%2F%2FsharepointSite%0AAdd-PnPDataRowsToProvisioningTemplate%20-Path%20PathToExistingFile%0A-List%20SimpleEmailTemplates%20-Query%20%22%22%3C%2FPRE%3E%3CP%3ENot%20sure%20what%20is%20wrong%20here.%20Am%20I%20using%20the%20command%20incorrectly%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-85131%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

I have been trying to extract data using the new PnP command

Add-PnPDataRowsToProvisioningTemplate

But I am getting a null reference exception:

 

 

Add-PnPDataRowsToProvisioningTemplate : Object reference not set to an instance of an object.
At line:1 char:1
+ Add-PnPDataRowsToProvisioningTemplate -Path PathToFile ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-PnPDataRowsToProvisioningTemplate], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.AddDataRowsToProvisioningTemplate

 

It does not give any useful information.
Here is what I tried with always the same result :

 

Connect-PnPOnline -Url http://sharepointSite
Add-PnPDataRowsToProvisioningTemplate -Path PathToExistingFile
-List Lists/SimpleEmailTemplates -Query '<View></View>' -Fields 'Title'


Or

Connect-PnPOnline -Url http://sharepointSite
Add-PnPDataRowsToProvisioningTemplate -Path PathToExistingFile
-List SimpleEmailTemplates -Query '<View></View>' -Fields 'Title'

Or

Connect-PnPOnline -Url http://sharepointSite
Add-PnPDataRowsToProvisioningTemplate -Path PathToExistingFile
-List SimpleEmailTemplates -Query ""

Not sure what is wrong here. Am I using the command incorrectly ?

0 Replies