SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Cannot reference Site Collection columns on when running a Site Design on a Subsite #3333

Open Mlavieri opened 5 years ago

Mlavieri commented 5 years ago

Category

Expected or Desired Behavior

When applying a Site Design on a subsite any columns available to the site should be able to be used in a Site Design.

Observed Behavior

When applying a Site Design to a sub site that creates a content type with a reference to a Site Column the design will fail with an error that "One or more of the properties on this action has an invalid type." Additionally if this script also creates a column a duplicate column will be created at the subsite level.

image

Steps to Reproduce

  1. Create a Site Design that creates a column and a content type such as the following

{ "$schema": "schema.json", "actions": [ { "verb": "createSiteColumn", "fieldType": "Text", "internalName": "mattsColumn", "displayName": "Matt's Column", "isRequired": false, "group": "A" }, { "verb": "createContentType", "name": "Matt's CT", "parentName": "Item", "hidden": false, "subactions": [ { "verb": "addSiteColumn", "internalName": "mattsColumn" } ] } ] }

  1. Apply the Site Design to a Site
  2. Create a subsite under the site the design was applied to in step 2. 4a. Run the Site Design on the Subsite 4b. Alternatively create a new Site Design that only creates a content type referencing the parent column

{ "$schema": "schema.json", "actions": [ { "verb": "createContentType", "name": "Matt's Sub CT", "parentName": "Item", "hidden": false, "subactions": [ { "verb": "addSiteColumn", "internalName": "mattsColumn" } ] } ] }

Thanks for your contribution! Sharing is caring.

msft-github-bot commented 5 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

adamtobia5 commented 5 years ago

Also experiencing this bug/issue. Didn't know that it was because of applying the site design to a Subsite. Will watch this issue for further developments.

CodingSinceThe80s commented 4 years ago

Hello all, just to bump up this issue a little bit: Its still there and honestly very annoying. Also the site script documentation explicitly says that this should be possible: See this link under addSiteColumn.