1

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

My best guess would be that you are using an invalid path thus the template object cannot be instantiated.

You can use Set-PnPTraceLog -On -Level Debug to enable debugging mode on any PnP PowerShell Cmdlets. Then you can re-run your command and you should now get the detailed error description that will let you know why the Provisioning Engine is failing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.