Issue provisioning taxonomy field using site script / site design
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
Provisioning a taxonomy field using a site script / site design should create the column. After setting the column value for an item, the item should be indexed by search and corresponding crawled and managed properties should be created automatically.
Observed Behavior
Field is created and usable in lists and libraries. Though no crawled and managed properties are created automatically so the field cannot be searched upon.
Steps to Reproduce
Added a site script which deploys a taxonomy field, a content type, and updates the Site Pages list to include this content type. Added this site script to a new site design which is bound to the communication site web template (68).
After creation of the site and finishing the execution of the site design I've added a new page (of the new content type) and added metadata.
After a couple of minutes SharePoint search shows the new page as a result, but no crawled or managed property is available for the taxonomy field.
Investigation leads to the fact that when the site is created based on the site design, the TaxonomyFieldAdded feature of SharePoint is not yet activated. Because of this the TaxCatchAll and TaxCatchAllLabel fields are not created and the crawled and managed properties are not picked up.
After I create a second site using the blank site design, wait for a few minutes and then apply the site design, the field is created and crawled and managed properties are available after the item is indexed.
Timing seems to be the issue here. I would expect the site design to be kicked off after all (default) features are activated.
See attached site script. Please mind that for the taxonomy field SSPID, GroupID, TermSetID need to be set to the ID's existing the the term store for your tenant.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
I think this is "by design" - it is not supported to create Taxonomy fields declaratively. See:
https://docs.microsoft.com/en-us/sharepoint/dev/general-development/managed-metadata-and-navigation-in-sharepoint
SharePoint does not support creating taxonomy fields (managed metadata site columns) declaratively by way of XML definition. SharePoint does not support the use of taxonomy fields (managed metadata site columns) in site templates.
This issue is being closed as part of an issue list cleanup project. Issues with no activity in the past 6 months that aren't tracked by engineering as bugs were closed as part of this inititive. If this is still an issue, please follow the steps outlined to re-open or submit a new issue.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues