2

I exported a site collection template that I wanted to apply a brand new site collection. The problems start with the form libraries:

    <pnp:ListInstance Title="Form-Index" Description="Form-Index" DocumentTemplate="{site}/FormIndex/Forms/template.xsn" TemplateType="115" Url="FormIndex" EnableVersioning="true" MinorVersionLimit="0" MaxVersionLimit="6" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-1e1d-4562-b56a-f05371bb0115" EnableAttachments="false" DefaultDisplayFormUrl="{site}/FormIndex/Forms/DispForm.aspx" DefaultEditFormUrl="{site}/FormIndex/Forms/EditForm.aspx" DefaultNewFormUrl="{site}/FormIndex/Forms/Upload.aspx" ImageUrl="/_layouts/15/images/itfl.png?rev=44" IsApplicationList="false" ValidationFormula="" ValidationMessage="">
      <pnp:ContentTypeBindings>
        <pnp:ContentTypeBinding ContentTypeID="0x010101" Default="true" />
        <pnp:ContentTypeBinding ContentTypeID="0x0120" />
      </pnp:ContentTypeBindings>
    </pnp:ListInstance>

The proces stops here with this:

Apply-PnPProvisioningTemplate : Invalid template URL. The template must exist in the Forms directory of this document library. Create the template in the Forms directory, and then re-type the Web address. Note that you cannot move or copy a template into the Forms directory.

This is strange, because the template indeed says:
DocumentTemplate="{site}/FormIndex/Forms/template.xsn"

The form library has a template created with InfoPath. The problem might be that the template itself is not downloaded, at least I don't see neither any trace in the template xml nor a file created in the target folder. I used the following command to create the pnp template:

Get-PnPProvisioningTemplate -Out "C:\Users\me\Documents\PnPtemplate\clone.xml" -Schema LATEST -PersistBrandingFiles -PersistPublishingFiles -Handlers All -IncludeNativePublishingFiles

I searched for the issue, but all I found was a bug on github related to content types and I don't use a custom content type.

So, the question is, how can I create the form library with PnP? Any advise appreciated.

Your Answer

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

Browse other questions tagged or ask your own question.