SOLVED

How many ways do we have to provision managed metadata column to SharePoint?

%3CLINGO-SUB%20id%3D%22lingo-sub-560964%22%20slang%3D%22en-US%22%3EHow%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-560964%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20know%20how%20many%20ways%20we%20have%20to%20create%20a%20managed%20metadata%20column%20in%20SharePoint%3F%20I%20am%20reading%20about%20it%2C%20and%20I%20am%20a%20bit%20confused.%20Some%20posts%20I've%20seen%20suggest%20to%20create%20the%20column%20with%20XML%20(note%20column%20and%20metadata%20column)%2C%20but%20then%20they%20say%20there%20must%20be%20a%20feature%20receiver%20to%20bind%20this%20column%20to%20the%20term%20set.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20wondering%20if%20there's%20a%20way%20to%20do%20this%20with%20SPFx%3F%20or%20it%20would%20be%20easier%20to%20do%20it%20with%20PowerShell%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20are%20the%20ways%20to%20create%20the%20managed%20metadata%20column%2C%20and%20what%20is%20the%20recommended%20way%20for%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-563412%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-563412%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F340655%22%20target%3D%22_blank%22%3E%40daniela1995%3C%2FA%3E%26nbsp%3BPersonally%2C%20I%20like%20to%20use%20Site%20Designs%20%2B%20Site%20Scripts%20to%20provision%20these%20columns%20out%20into%20environments.%20And%20you%20don't%20need%20feature%20receivers%20to%20attach%20them%20to%20term%20sets.%20However%2C%20there%20are%20many%20ways%20you%20can%20do%20this.%3CBR%20%2F%3E%3CBR%20%2F%3E1.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-overview%3C%2FA%3E%3CBR%20%2F%3E2.%20SPFx%20%2B%20Feature%20Framework%20(Not%20my%20first%20choice%2C%20unless%20you%20are%20deploying%20columns%20for%20a%20specific%20spfx%20solution.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fweb-parts%2Fget-started%2Fprovision-sp-assets-from-package%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fweb-parts%2Fget-started%2Fprovision-sp-assets-from-package%3C%2FA%3E%3CBR%20%2F%3E3.%20PowerShell%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-565320%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-565320%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39836%22%20target%3D%22_blank%22%3E%40Beau%20Cameron%3C%2FA%3E%26nbsp%3B%20Thank%20you%20for%20your%20response.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20would%20use%20SPFx%2C%20how%20would%20you%20bind%20the%20column%20to%20the%20terms%3F%20Since%20SPFx%20will%20still%20use%20the%20feature%20framework%20which%20needs%20feature%20receiver%20(in%20farm%20solutions).%20So%20how%20would%20you%20do%20that%20step%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20requirement%20is%2C%20I%20have%20a%20webpart%2C%20that%20needs%20to%20pull%20some%20data%20from%202%20lists.%20One%20is%20master%2C%20the%20second%20will%20have%20a%20lookup%20column%20to%20the%20first%20list%2C%20plus%20managed%20metadata%20columns%20to%20tag%20these%20items.%20So%20I%20was%20thinking%20I'd%20have%20everything%20in%20the%20same%20solution.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-570577%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-570577%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F340655%22%20target%3D%22_blank%22%3E%40daniela1995%3C%2FA%3E%26nbsp%3BSo%20if%20you%20already%20know%20the%20environment%20it's%20going%20into%20you%20could%20update%20the%20Elements%20xml%20file%20with%20the%20termstore%2Fterm%20groups%20id.%20Otherwise%2C%20you'll%20have%20to%20do%20it%20via%20code%20inside%20the%20SPFx%20web%20part.%20(Check%20if%20it%20exists%2C%20if%20not%2C%20add%20columns)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-572291%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572291%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39836%22%20target%3D%22_blank%22%3E%40Beau%20Cameron%3C%2FA%3E%26nbsp%3B%3CEM%3Evia%20code%20inside%20the%20SPFx%20webpart.%3C%2FEM%3E%20Does%20that%20mean%20I%20have%20to%20place%20the%20webpart%20somewhere%2C%20open%20it%2C%20so%20the%20code%20would%20get%20executed%20and%20bind%20the%20columns%2C%20or%20is%20there%20an%20event%20receiver%20when%20the%20SPFx%20webpart%20is%20deployed%20that%20I%20can%20use%20to%20write%20this%20code%3F%20What%20I%20want%20to%20ask%20is%2C%20where%20would%20this%20code%20be%20placed%20in%20the%20spfx%20webpart%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-637806%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-637806%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F340655%22%20target%3D%22_blank%22%3E%40daniela1995%3C%2FA%3E%26nbsp%3BWhat%20I%20mean%20by%20that%20is%2C%20when%20you%20add%20the%20web%20part%20on%20the%20page%20and%20you%20open%20up%20the%20web%20part%20properties%2C%20have%20the%26nbsp%3B%20web%20part%20property%20configuration%20create%20the%20list%20for%20you%20(if%20it%20doesn't%20exist).%20That%20way%2C%20whenever%20the%20web%20part%20is%20actually%20used%2C%20it%20allows%20the%20user%20to%20select%20from%20an%20already%20deployed%20list%2C%20or%20the%20ability%20to%20generate%20a%20new%20one.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-646266%22%20slang%3D%22en-US%22%3ERe%3A%20How%20many%20ways%20do%20we%20have%20to%20provision%20managed%20metadata%20column%20to%20SharePoint%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-646266%22%20slang%3D%22en-US%22%3EThank%20you!%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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. 

6 Replies
Highlighted
Solution

@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-...
3. PowerShell

Highlighted

@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. 

Highlighted

@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)

Highlighted

@Beau Cameron via code inside the SPFx webpart. Does that mean I have to place the webpart somewhere, open it, so the code would get executed and bind the columns, or is there an event receiver when the SPFx webpart is deployed that I can use to write this code? What I want to ask is, where would this code be placed in the spfx webpart? 

Highlighted

@daniela1995 What I mean by that is, when you add the web part on the page and you open up the web part properties, have the  web part property configuration create the list for you (if it doesn't exist). That way, whenever the web part is actually used, it allows the user to select from an already deployed list, or the ability to generate a new one.

Highlighted