Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sppnp-extract-configuration does not work with server relative list URLs #481

Open
johannes-z opened this issue Oct 5, 2021 · 0 comments

Comments

@johannes-z
Copy link

johannes-z commented Oct 5, 2021

I want to export a list with all its items. The configuration schema states, that I should be able to use /Lists/<Internal Name>, but nothing is being exported. This is my current configuration:

{
  "$schema":"https://aka.ms/sppnp-extract-configuration-schema",
  "persistAssetFiles": true,
  "handlers": [
    "Lists"
  ],
  "lists": {
    "lists": [
      {
        "title": "/sites/xyz/Lists/MyList",
        "includeItems": true
      }
    ]
  }
}

For title I tried:

  • /sites/xyz/Lists/MyList
  • /Lists/MyList
  • Lists/MyList
  • lists/MyList
  • /MyList
  • MyList

Only the display name works.

I found this line, which should actually perform this check:

&& !creationInfo.ExtractConfiguration.Lists.Lists.Any(i => siteList.RootFolder.ServerRelativeUrl.EndsWith(i.Title, StringComparison.InvariantCultureIgnoreCase) && i.IncludeItems))

With pnpjs:

import { sp } from "@pnp/sp/presets/all"

(() => {
  sp.web.getList('/sites/xyz/Lists/MyList').rootFolder
    .get()
    .then(console.log)
})()

prints: { ..., ServerRelativeUrl: "/sites/xyz/Lists/MyList", ... }

@johannes-z johannes-z changed the title spppnpnp-extract-configuration does not work with server relative list URLs sppnp-extract-configuration does not work with server relative list URLs Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant