Forum Discussion

Abel García Celestrín's avatar
Abel García Celestrín
Copper Contributor
Jan 25, 2017
Solved

Get-PnPProvisioningTemplate and workflows

In my today's SharePoint situation I need to replicate an website from a dev environment into another dev environment (without content, only structures). I have been looking to the

 

Get-PnPProvisioningTemplate

cmdlet of the SharePoint PnP Powershell. However it seems that the generated template doesn't include existing workflows associated to the current lists, not even in the case of OOB workflows like "Approval". Is there a workaround for this using PnP or other existing tools?

Thanks in advance

  • According to PnP-Core code, the ObjectWorkflow ObjectHandler should extract Workflows lists, so, as Paul said, did you try with latest version?

    Also, you can enable Debug before running the Get-PnPProvisioning template:
    Set-SPOTraceLog -On -Level Debug
    and let us know if there's any error.

16 Replies

  • According to PnP-Core code, the ObjectWorkflow ObjectHandler should extract Workflows lists, so, as Paul said, did you try with latest version?

    Also, you can enable Debug before running the Get-PnPProvisioning template:
    Set-SPOTraceLog -On -Level Debug
    and let us know if there's any error.
    • Abel García Celestrín's avatar
      Abel García Celestrín
      Copper Contributor

      Thanks for your time. I found the issue. I was generating xml templates. It turns out that wf information is included as a separated xaml file, so in order to get this you need to export to the open xml (pnp) file format. Perhaps there is some flag to generate those files and still use the pure xml format for the template (kind of what you do with the PersistBrandingFiles flag.

      • Luis Mañez's avatar
        Luis Mañez
        MVP
        It's weird, cos there's no special Flag to that, and in theory, should place all the extracted Files in the same path specified in the -Out flag. Are you using a full path in the -Out flag? (kind of c:/temp/template.xml)
        Anyway, if works fine with the .pnp extension, we're good :)
  • Anonymous's avatar
    Anonymous

    Hi Abel,

     

    have you been using the latest version of PNP? what i get normally is the template and the xaml files.

     

    kr,

     

    Paul

    • Abel García Celestrín's avatar
      Abel García Celestrín
      Copper Contributor
      Yes last version and everything. I just notice that workflow info is not generated when using xml format, at least not without any aditional flags. I exported the template as pnp and solved the issue. Thanks!
      • Anonymous's avatar
        Anonymous

        Maybe my blog https://sharepoint-specialist.nu/how-to-implement-sharepoint-workflow-with-custom-forms-in-pnp-template-3a515cbfd88#.jef62njbw will help you!

Resources