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

Invoke-PnPSiteScript does not add List Columns to existing list #1072

Open
jh-sigmadx opened this issue Oct 16, 2024 · 1 comment
Open

Invoke-PnPSiteScript does not add List Columns to existing list #1072

jh-sigmadx opened this issue Oct 16, 2024 · 1 comment

Comments

@jh-sigmadx
Copy link

jh-sigmadx commented Oct 16, 2024

I provisioned a Site and Lists from a Site Script.

I then amended the Site Script to add another field to one of the lists.

I then ran the Invoke-PnPSiteScript again, expecting the new column to be created.

It was not.

The documentation here:
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview

Clearly states:
"Site scripts can be run again on the same site after provisioning. Site scripts are non-destructive, so when they run again, they ensure that the site matches the configuration in the script.

For example, if the site already has a list with the same name that the site script is creating, the site script will only add missing fields to the existing list."

The Create List Step outputted:
ErrorCode : 0
Outcome : 0
OutcomeText :
Target : ########## (redacted)
TargetId : 92509bd0-1a58-4e7f-b20c-3af7e3ab6abe
Title : Create or update list "Contacts"

  • I notice that the step is specifically named "Create or Update list..."

The Output of the SiteScript Step for adding the additional field looks like this:

ErrorCode : 0
Outcome : 0
OutcomeText :
Target :
TargetId :
Title : Add list column "TESTAddColumn"

Notice that NO error was given, but also that the "Outcome" = 0.
Again, The Column was NOT created in the list

@jh-sigmadx
Copy link
Author

jh-sigmadx commented Oct 22, 2024

So, in the last week, it would seem this has changed yet again,

When I run my script now, I get the output:
ErrorCode : -2130575342
Outcome : 2
OutcomeText : List with name Contacts already exists.
Target :
TargetId :
Title : Create or update list "Contacts"

And the Create Column steps are NOT even executed..

What's going on?

Powershell Version: 7.4.4
PnP version: 2.12.0

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