Sp-dev-docs: Creating Managed Metadata Site Columns - Confusing Doc at Best

Created on 16 May 2019  Â·  4Comments  Â·  Source: SharePoint/sp-dev-docs

The two verbs addSPFieldXml and createSiteColumnXml seem to have circular explanations. Because of this it is also unclear whether we can reliably create Managed Metadata columns with either.

From addSPFieldXml:
Currently these field constructs cannot be designated as site columns nor added to content types. To create site columns with Field XML use the createSiteColumnXml action.

From createSiteColumn / createSiteColumnXml:
fieldType – The type of column to add. Supported values - like SPField - are Text, Note, Number, Boolean, User, and DateTime. For other data types, refer to the addSPFieldXml script action.

Managed Metadata columns (which were never my favorite in classic) HAVE to be integral to a good IA in the new, flat, modern topology.

If, like I am rapidly surmising, Managed Metadata columns can be created in Site Scripts with no warnings, but they don't behave reliably, there is a significant hole in what Site Scripts can accomplish. If we need to resort to the Content Type Hub to reliably create these Site Columns and Content Types which use them, this should be VERY CLEAR in the documentation. Otherwise, we end up with IA that looks as though it is created correctly, but in fact does not work. (Not to mention the wasted time in writing the Site Scripts and deploying them.)

This detracts form the belief that Site Scripts are a good way to go (try explaining the wasted days figuring this out to a client). I want to move to using Site Scripts, but I'm finding they are brittle in several ways, and this is one of them.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

docs docs-comment other site-design question

All 4 comments

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

I completely agree with @sympmarc on this, and there are many issues outside of just MMS columns that are effected by not being idempotent.

To give a brief history of my experience with the MMS columns... I had written a blog post back in November after having a conversation with Sean Squires on Twitter around MMS and on November 5th, he noted there was no native support at the time for MMS columns. However, my method for creating MMS columns did work successfully in a repetitive fashion.

image

Around this same time, a PowerShell command called "Get-SPOSiteScriptFromList" was put into documentation PR, and it noted that "Managed metadata fields cannot be extracted at this time.". I was totally fine with that, because I knew MMS wasn't currently supported.

However, on January 10th, Sean removed the limitation on generating Managed Metadata columns using this PowerShell command in a PR . This gives me the impression that Managed Metadata columns were _now supported_ in Site Scripts. Turns out, there is an issue with extracting mms columns using Get-SPOSiteScriptFromList and then applying the result in a Site Design.

  1. Deploying an extracted MMS field works the first time, but all subsequent invocations of the site design removes the connection of the MMS field to the term store (not idempotent!).

As a result, I always go back to my method (in my blog post) for creating MMS columns (as term store connection doesn't break). However, there was a change at some point which has caused other methods to not be idempotent. While, I can successfully deploy MMS columns using my method, we can't attach them to a site ContentType when we specify a Content Type Id in the site script (it fails), forcing us to generate new Content Type IDs on every single site, which is not great from a development requirement standpoint.

It would be nice to have some guidance and clarity on the MMS column issue we are seeing, as well as why site designs are not idempotent when you specify IDs in Content Types -- as it's making the use of Site Designs impractical for use in production environments.

@VesaJuvonen - it's also a doc issue (start of my tirade above), as the schema doc has circular information.

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 the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

byrongits picture byrongits  Â·  3Comments

waldekmastykarz picture waldekmastykarz  Â·  3Comments

SteIvanov picture SteIvanov  Â·  3Comments

waldekmastykarz picture waldekmastykarz  Â·  3Comments

jonthenerd picture jonthenerd  Â·  3Comments