Forum Discussion
How many ways do we have to provision managed metadata column to SharePoint?
I would like to know how many ways we have to create a managed metadata column in SharePoint? I am reading about it, and I am a bit confused. Some posts I've seen suggest to create the column with XML (note column and metadata column), but then they say there must be a feature receiver to bind this column to the term set.
I am wondering if there's a way to do this with SPFx? or it would be easier to do it with PowerShell?
What are the ways to create the managed metadata column, and what is the recommended way for it?
Thanks.
daniela1995 Personally, I like to use Site Designs + Site Scripts to provision these columns out into environments. And you don't need feature receivers to attach them to term sets. However, there are many ways you can do this.
1. https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
2. SPFx + Feature Framework (Not my first choice, unless you are deploying columns for a specific spfx solution. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp-assets-from-package
3. PowerShell
6 Replies
daniela1995 Personally, I like to use Site Designs + Site Scripts to provision these columns out into environments. And you don't need feature receivers to attach them to term sets. However, there are many ways you can do this.
1. https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
2. SPFx + Feature Framework (Not my first choice, unless you are deploying columns for a specific spfx solution. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp-assets-from-package
3. PowerShell- daniela1995Copper Contributor
Beau Cameron Thank you for your response.
If you would use SPFx, how would you bind the column to the terms? Since SPFx will still use the feature framework which needs feature receiver (in farm solutions). So how would you do that step?
My requirement is, I have a webpart, that needs to pull some data from 2 lists. One is master, the second will have a lookup column to the first list, plus managed metadata columns to tag these items. So I was thinking I'd have everything in the same solution.
daniela1995 So if you already know the environment it's going into you could update the Elements xml file with the termstore/term groups id. Otherwise, you'll have to do it via code inside the SPFx web part. (Check if it exists, if not, add columns)