Office 365 – PnP Provisioning Engine – Making external lists work

The current version of the PnP provisioning enexternalgine doesn’t like external lists.

hen exporting a template external lists are included in the PnP templates, however some of the information needed to recreate the external list is missing:

<pnp:ListInstance Title="Client" Description="" DocumentTemplate="" OnQuickLaunch="true" TemplateType="600" Url="Lists/Client" MinorVersionLimit="0" MaxVersionLimit="0" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-9549-43f8-b978-e47e54a10600" EnableAttachments="false" EnableFolderCreation="false">
            <pnp:ContentTypeBinding ContentTypeID="0x01" Default="true" />
            <View Name="{3EA48E9F-5C84-4DBB-8921-B81105E6A2AF}" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="ReadAllClient" Url="/clients/template/Lists/Client/ReadAllClient.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/generic.png?rev=44">
              <Method Name="ReadAllClient" />
                  <FieldRef Name="ClientID" />
                <FieldRef Name="ClientID" ListItemMenu="TRUE" LinkToItem="TRUE" />
                <FieldRef Name="Name" />
                <FieldRef Name="Sector" />
                <FieldRef Name="Status" />
                <FieldRef Name="KeyContact" />
                <FieldRef Name="AddressID" />
              <RowLimit Paged="TRUE">30</RowLimit>
              <Aggregations Value="Off" />
            <Field DisplayName="BDC Identity" Hidden="FALSE" Name="BdcIdentity" SourceID="" StaticName="BdcIdentity" Type="Text" ReadOnly="TRUE" />
            <Field DisplayName="ClientID" Hidden="FALSE" Name="ClientID" SourceID="" StaticName="ClientID" Type="Integer" ReadOnly="TRUE" Required="TRUE" />
            <Field DisplayName="Name" Hidden="FALSE" Name="Name" SourceID="" StaticName="Name" Type="Text" />
            <Field DisplayName="Code" Hidden="FALSE" Name="Code" SourceID="" StaticName="Code" Type="Text" />
            <Field DisplayName="Sector" Hidden="FALSE" Name="Sector" SourceID="" StaticName="Sector" Type="Text" />
            <Field DisplayName="Status" Hidden="FALSE" Name="Status" SourceID="" StaticName="Status" Type="Text" />
            <Field DisplayName="KeyContact" Hidden="FALSE" Name="KeyContact" SourceID="" StaticName="KeyContact" Type="Text" />
            <Field DisplayName="AddressID" Hidden="FALSE" Name="AddressID" SourceID="" StaticName="AddressID" Type="Integer" Required="TRUE" />

When applying this list an error appears:

List ‘Client’ does not exist at site with URL ‘ Lists/Client’

When running from PnP PowerShell the full error is as follows.

PowerShell_ISE.exe Information: 0 : 2017-02-06 21:13:48.5214 [List instances] [13] [Debug] Creating list Client failed: List ‘Client’ does not exist at site with URL ‘
Lists/Client’. : at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay)
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.CreateList(Web web, ListInstance list, TokenParser parser, PnPMonitoredScope scope, Bo
olean isNoScriptSite)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, Provision
ingTemplateApplyingInformation applyingInformation) 1044ms af22d037-7a45-4a0b-a0aa-38b9a19dea2e
PowerShell_ISE.exe Information: 0 : 2017-02-06 21:13:48.5244 [List instances] [13] [Debug] Code execution scope ended 1047ms af22d037-7a45-4a0b-a0aa-38b9a19dea2e
PowerShell_ISE.exe Information: 0 : 2017-02-06 21:13:48.5259 [Provisioning] [13] [Debug] Code execution scope ended 12482ms af22d037-7a45-4a0b-a0aa-38b9a19dea2e
Apply-PnPProvisioningTemplate : List ‘Client’ does not exist at site with URL ‘Lists/Client’.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Web “clients/123456” -Path “C:\Workspa …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Man Happy [Apply-PnPProvisioningTemplate], ServerException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate


This series of posts will look at:

  1. Applying templates using a web service
  2. Removing external lists from the pnp template
  3. Creating external lists through CSOM within a web service



Please leave a comment or feedback

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.