Forum Discussion
How many ways do we have to provision managed metadata column to SharePoint?
- May 13, 2019
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
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
- daniela1995May 14, 2019Copper 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.
- Beau CameronMay 15, 2019MVP
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)
- daniela1995May 16, 2019Copper Contributor
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?