0

I am creating templates using the PnP provisioning but am noticing the items are not being created. I have this .json file

{
    "$schema":"https://aka.ms/sppnp-extract-configuration-schema",
    "persistAssetFiles": false,
    "handlers": [
        "Lists",
        "WebSettings",
        "Pages"
    ],
    "lists": {
        "lists": [
            {
                "title": "MyData",
                "includeItems": true
            }
        ]
    },
    "pages": {
        "includeAllClientSidePages": true
    }
}

and the exported XML file has the datarows data in it, but when I apply it to a site, the lists that get created don't have the data in it. Does anyone know what's wrong?

1
  • What command are you using to publish the XML file? Also can you post a snippet of the area around <Datarows>? Edit: please also add the version of pnp you are using, and try with the latest version as well. Older releases were able to export but not import IIRC
    – tunaahi333
    Commented Dec 8, 2020 at 21:15

1 Answer 1

0

Not all fields (especially the built-in fields) could be imported, it will cause the item creation gets failed.

Hence I suggest you only keep the expected fields. You can use Add-PnPDataRowsToProvisioningTemplate to help to add data rows or use below quick way to choose the fields to extract for items.

"lists": {
    "lists": [
        {
            "title": "MyData",
            "includeItems": true,
            "query": {
                "viewFields": ["Title"]
            }
        }
    ]
},

BR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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